You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Eric Wilson <wi...@gmail.com> on 2013/03/27 15:19:25 UTC
Using multiple text files for Suggestor dictionarys
I'm using the Suggester component for autocomplete. I have a variety of
types of suggestions that I would like to offer, such as locations, company
names, products, and dictionary words.
These lists vary in size and volatility, so keeping them all in the same
text file is not the most convenient.
I'm using text files because I want the ability to add weights to the terms
suggested.
Is it possible to use multiple text files? I tried the following:
<!-- WFSTLookup suggest component --> <searchComponent class=
"solr.SpellCheckComponent" name="suggestword"> <lst name="spellchecker"> <
str name="name">suggestword</str> <str name="classname">
org.apache.solr.spelling.suggest.Suggester</str> <str name="lookupImpl">
org.apache.solr.spelling.suggest.fst.WFSTLookupFactory</str> <str name=
"storeDir">suggestword</str> <str name="buildOnCommit">false</str> <!--
Suggester properties --> <bool name="exactMatchFirst">true</bool> <str name=
"sourceLocation">../data/words.txt</str> <str name="sourceLocation">
../data/cities.txt</str> </lst>
But the second list, the cities, are apparently undetected, after
restarting the tomcat and rebuilding the dictionary. Can this be done? If
not, how would you recommend managing different dictionaries?
Thanks,
Eric Wilson
Re: Using multiple text files for Suggestor dictionarys
Posted by Chris Hostetter <ho...@fucit.org>.
: Is it possible to use multiple text files? I tried the following:
...
: But the second list, the cities, are apparently undetected, after
: restarting the tomcat and rebuilding the dictionary. Can this be done? If
: not, how would you recommend managing different dictionaries?
Skimming the code, it does not appear to currently be possible. I think
as things stand, your ownly recourse is to cat your multiple files
together as part of whatever process you currently use to generate them.
If you'd like to open a feature request in Jira, it looks like it would be
semi-straight forward to support specifying multiple file names.
-Hoss