On 03.02.2010, at 14:34, Ahmet Arslan wrote: > >> Actually I plan to write a bigger blog post about the >> approach. In order to match the different fields I actually >> have a separate core with an index dedicated to auto suggest >> alone where I merge all fields together via some javascript >> code: >> >> This way I can then use terms for a single word entered and >> a facet prefix search with the last term as the prefix and >> the rest as the query for multi term entries into the auto >> suggest box. >> >> The idea is that I can then enter any part of any of the >> fields, but I will then be suggested the entire phrase in >> that field: >> >> So if I have a field: >> Foo Bar Ding Dong >> >> and I enter "ding" into the search box, I would get a >> suggestion of "Foo Bar Ding Dong" > > If I am not wrong you have a list of suggestion candidates indexed in a > separate core dedicated to auto suggest alone. > > I think you can use this field type for suggestion. > > <fieldType name="prefix_token" class="solr.TextField" > positionIncrementGap="1"> > <analyzer type="index"> > <tokenizer class="solr.WhitespaceTokenizerFactory" /> > <filter class="solr.LowerCaseFilterFactory" /> > <filter class="solr.EdgeNGramFilterFactory" minGramSize="1" maxGramSize="20" > /> > </analyzer> > <analyzer type="query"> > <tokenizer class="solr.WhitespaceTokenizerFactory" /> > <filter class="solr.LowerCaseFilterFactory" /> > </analyzer> > </fieldType>
hmm .. not sure yet if i like this approach better. it seems i cannot use dismax here, at least its not finding matches, which means i need to parse the query to prevent people from going crazy stuff. also in the old approach i was suggesting single words first and then slowly help people towards a full phrase. with this approach i immediately end up with full phrases, which severely limits the usefulness. at the same time i am not sure if the index will really be significantly smaller with this approach than with my hack. and since there can also be matches inside words that have no real meaning i am also not sure if this really gets me better quality on this level either. will play around with this some more tough. regards, Lukas Kahwe Smith m...@pooteeweet.org