I had a requirement to make all optional parameters in query to match i.e. make all of them mandatory. We didnt wanted to write parsing logic and add + sign in front of each expresion.
It seems edismax was the answer and you have to just set mm to 100%. All you need to do from solrj is
SolrQuery solrQuery = new SolrQuery();
solrQuery.set("defType", "edismax");
solrQuery.set("mm", "100%");
I also had this requirement to match use user's input against 5-6 fields. There are two solutions:
1) user copyFields in schema.xml and append everything to a field called as "textDump" and then you can make this as the default field.
2) use dismax parser.
I chose to use dismax because copyFields will increase the index size to almost double and solr performance is directly proportional to index size.
Hurray dismax as it neatly solved both my requirements:).
It seems edismax was the answer and you have to just set mm to 100%. All you need to do from solrj is
SolrQuery solrQuery = new SolrQuery();
solrQuery.set("defType", "edismax");
solrQuery.set("mm", "100%");
I also had this requirement to match use user's input against 5-6 fields. There are two solutions:
1) user copyFields in schema.xml and append everything to a field called as "textDump" and then you can make this as the default field.
2) use dismax parser.
I chose to use dismax because copyFields will increase the index size to almost double and solr performance is directly proportional to index size.
Hurray dismax as it neatly solved both my requirements:).
Comments
Post a Comment