0

When does Solr (v4) generate or build its suggestions (when indexing or when searching)?

Because, I dont understand the two options buildOnCommit & buildOnOptimize in Solr? Which of the two is the best (in speed and efficiency) to use?

And, in the configuration file solrconfig.xml, is there a parameter to adjust tolerance in order to have multiple suggestions even if the number of different letters between the query & the suggestion is equal to four ?

Hakim
  • 3,225
  • 5
  • 37
  • 75
  • can you give examples of required "tolerance"? – Artem Lukanin Sep 09 '13 at 17:00
  • For example, when I type `renou` it gets me `renault` even if there are other words which are closer. – Hakim Sep 09 '13 at 20:50
  • Can you give an example of "closer" words? – Artem Lukanin Sep 12 '13 at 04:09
  • The suggestion it's giving for the query: `renou` is `rendu`, but I wish to have `renault` too, but maybe I'm asking for too much, because the suggestion it's giving me is closer, but I wonder if it can be more tolerant and give me more suggestions? – Hakim Sep 12 '13 at 20:22
  • I've updated the answer: try to set `spellcheck.alternativeTermCount=1000` and then decrease this number to make the search faster. – Artem Lukanin Sep 13 '13 at 09:28
  • Thanks! I will try this property this weekend and I'll give you the result returned. – Hakim Sep 13 '13 at 13:30
  • Do I need to re-index when I change `spellcheck.alternativeTermCount` value? – Hakim Sep 16 '13 at 09:17
  • No, it is the number of hypotheses to read from the existent index. – Artem Lukanin Sep 16 '13 at 11:54
  • It's not changing the results I'm getting. I dont know if my index is too small but almost every query return only one suggestion. I think that this configuration is too rigid. – Hakim Sep 16 '13 at 16:27
  • It's hard to discuss this topic in general. If you make a separate question out of your second question and give the spellchecker configuration, it will be easier to give exact answers. – Artem Lukanin Sep 18 '13 at 11:51
  • I have posted my question is a separate thread: [Multiple suggestions by query](http://stackoverflow.com/questions/18874157/solr-how-to-obtain-multiple-suggestions-for-a-query) – Hakim Sep 18 '13 at 14:02

1 Answers1

1

buildOnOptimize is practically useless, you can optimize your index only manually from the admin panel, for example. buildOnCommit will rebuild your suggestions index too often (depending on the hardCommit settings in solrconfig.xml). It is better to rebuild suggestions manually using cron jobs by adding spellcheck.build=true to the spellcheck handler.

Try to increase spellcheck.count and set spellcheck.onlyMorePopular=false to show more suggestions.

If you still receive less results, than spellcheck.count try to increase spellcheck.alternativeTermCount (the bigger the slower).

Artem Lukanin
  • 556
  • 3
  • 15
  • Thanks for details about how to get more result, but I'm affraid that won't get me more results. Because `spellcheck.count` is equal to 10, and changing `spellcheck.onlyMorePopular` to false havent gotten me more suggestions. **P.S:** I have modified the `/spell` request handler. – Hakim Sep 10 '13 at 09:05