SourceForge.net Logo
Main Overview Wiki Issues Forum Build Fisheye
Issue Details (XML | Word | Printable)

Key: CMP-783
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Shay Banon
Reporter: Benjamin Papez
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Compass

LuceneProperty to work with Fieldable and not Field directly

Created: 21/Nov/08 04:12 PM   Updated: 21/Nov/08 04:38 PM
Component/s: Compass::Core
Affects Version/s: 2.0.3, 2.1.1
Fix Version/s: 2.1.1, 2.2.0 M1


 Description  « Hide
Since Lucene 2.1.0 it is possible to configure that certain fields from the document are read with lazy loading. Therefore Compass may trigger ClassCastException, because it sometimes still uses org.apache.lucene.document.Field whereas org.apache.lucene.document.Fieldable would be better.

It should be changed at least in the following classes:

org.compass.core.lucene.LuceneProperty:

private Fieldable field;

public LuceneProperty(Fieldable field) { this.field = field; }

public LuceneProperty(Fieldable field, RepeatableReader reader) { this.field = field; this.reader = reader; }

public Fieldable getField() { return this.field; }

org.compass.core.lucene.LuceneResource:

public LuceneResource(String alias, Document document, int docNum, LuceneSearchEngine searchEngine) {
...
List fields = document.getFields();
for (Iterator fieldsIt = fields.iterator(); fieldsIt.hasNext() { Fieldable field = (Fieldable) fieldsIt.next(); LuceneProperty lProperty = new LuceneProperty(field); lProperty.setPropertyMapping(resourceMapping.getResourcePropertyMapping(field.name())); properties.add(lProperty); }
}



 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Shay Banon added a comment - 21/Nov/08 04:36 PM
Changing the title of the issue since people might be confused with actually supporting lazy fileds in Compass in terms of mapping declarations or using something similar to FieldSelectors (which is something the Compass should do, but that will be a different issue).