Only query FULL_RECIPE when searching
This simplifies things for some more complicated policy logic I'd like to implement. I'll leave query smartness for the graph model and generalized logic instead of queryparser magic.
- Id
- 7244fb1319e5fe6ee03c151a4d102b3399917267
- Author
- Caio
- Commit time
- 2019-04-14T18:04:57+02:00
Modified src/main/java/co/caio/cerberus/search/FulltextQueryParser.java
private static final int FEATURES = NOT_OPERATOR | PHRASE_OPERATOR | WHITESPACE_OPERATOR;
- private static final Map<String, Float> weights =
- Map.of(
- IndexField.NAME, 1f,
- IndexField.INGREDIENTS, 1f,
- IndexField.INSTRUCTIONS, 0.5f);
+ private static final Map<String, Float> weights = Map.of(IndexField.FULL_RECIPE, 1F);
FulltextQueryParser(Analyzer analyzer) {
super(analyzer, weights, FEATURES);