It is possible to create query that will search in all fields that have names with a given prefix?
I need that because I need to index some info that comes with an object that I'm indexing, e.g. category. Categories can have different levels. I want to give different boosts to different category levels.
I have noticed that I can add a field more than once while indexing.
Can I just add this catName
field multiple times, with different boost and then search it as it is was one field?
int level = 1;
for (Category cat : sortedCategories) {
float boost = CATEGORY_BOOST / level;
String catName = CATEGORY_NAME + String.valueOf(level);
TextField categoryName = new TextField(catName, cat.getName(),
Field.Store.NO);
categoryName.setBoost(boost);
doc.add(categoryName);