We're updating the issue view to help you get more done. 

No way to make fields Sortable inside of custom FieldBridge

Description

I'm using a custom FiledBridge to add a lot of fields to the document from a complex Map:

TranslatedInfoBridge.java

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 public class TranslatedInfoBridge implements FieldBridge { @Override public void set(String name, Object value, Document document, LuceneOptions luceneOptions) { if (value == null){ return; } Map<Language, TranslatedInfo> translatedInfoMap = (Map<Language, TranslatedInfo>) value; for (Language lang : translatedInfoMap.keySet()) { TranslatedInfo info = translatedInfoMap.get(lang); luceneOptions.addNumericFieldToDocument( name + "." + lang.name() + ".count", info.getCount(), document); luceneOptions.addNumericFieldToDocument( name + "." + lang.name() + ".rating", info.getRating(), document); luceneOptions.addNumericFieldToDocument( name + "." + lang.name() + ".views", info.getViews(), document); ........ } } }

Language is enumeration with around 30 values and fields name + "." + lang.name() + ".count" and name + "." + lang.name() + ".views" should be sortable. As far as I see there is no way to tell the engine about that. @Sortable annotation is not suitable for this case.

Environment

None

Status

Assignee

Gunnar Morling

Reporter

Ashot Golovenko

Labels

None

Suitable for new contributors

None

Feedback Requested

None

Components

Fix versions

Affects versions

5.5.0.Final

Priority

Critical