lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Neil Lott <neilmatthewl...@yahoo.com>
Subject AutoSuggest Question
Date Tue, 29 Jun 2010 04:58:10 GMT
Hi,

I've read some on the autosuggest and I would like to know if the following is possible with
my current configuration.

I'm using solr 1.4.


<field name="title" type="text" indexed="true" stored="true" required="true"/>
<field name="titleac3" type="autocomplete3" indexed="true" stored="true" omitNorms="true"
omitTermFreqAndPositions="true"/>
<copyField source="title" dest="titleac3"/>

<fieldType name="autocomplete3" class="solr.TextField" positionIncrementGap="100">
            <analyzer type="index">
                <tokenizer class="solr.LetterTokenizerFactory"/>
                <filter class="solr.LowerCaseFilterFactory"/>
                <filter class="solr.EdgeNGramFilterFactory" minGramSize="1" maxGramSize="25"/>
            </analyzer>
            <analyzer type="query">
                <tokenizer class="solr.LetterTokenizerFactory"/>
                <filter class="solr.LowerCaseFilterFactory"/>
            </analyzer>
        </fieldType>

Results:

http://localhost:8984/solr/core/select/?q=titleac3:%22secret%22&version=2.2&start=0&rows=10&indent=on&fl=title

I currently get the following results:

<doc>
<str name="title">Pasajes Secretos</str>
</doc>
−
<doc>
<str name="title">Secret Agent Zero</str>
</doc>
−
<doc>
<str name="title">Secretos de la Ciudad</str>
</doc>
−
<doc>
<str name="title">Back to the Secret Garden</str>
</doc>
−
<doc>
<str name="title">The Making Of: The Secret Life of Bees</str>
</doc>
−
<doc>
<str name="title">Sexy Celebrity Secrets</str>
</doc>
−
<doc>
<str name="title">The Secrets of the Battle of the Bulge</str>
</doc>
−
<doc>
<str name="title">The Secret Life of Bees</str>
</doc>
−
<doc>
<str name="title">Ancient Secrets of the Bible</str>
</doc>
−
<doc>
<str name="title">Secrets of the Submarine War</str>
</doc>


I'd like a way for the results to be sorted so it looks like this:


−
<doc>
<str name="title">Secret Agent Zero</str>  (found in 1st word)
</doc>
−
<doc>
<str name="title">The Secrets of the Battle of the Bulge</str> (found in 1st word)
</doc>
−
<doc>
<str name="title">The Secret Life of Bees</str> (found in 1st word)
</doc>
−
<doc>
<str name="title">Secrets of the Submarine War</str> (found in 1st word)
</doc>
-
<doc>
<str name="title">Secretos de la Ciudad</str> (found in 1st word)
</doc>
-
<doc>
<str name="title">Ancient Secrets of the Bible</str> (found in 2nd word)
</doc>
-
<doc>
<str name="title">Back to the Secret Garden</str> (found in 2nd word)
</doc>
-
<doc>
<str name="title">The Making Of: The Secret Life of Bees</str> (found in 2nd word)
</doc>
−
<doc>
<str name="title">Pasajes Secretos</str> (found in 2nd word)
</doc>
-
<doc>
<str name="title">Sexy Celebrity Secrets</str> (found in 3rd word)
</doc>


So I'd like to have the first matches are where secret happens in the first word or second
leading sub-word grouped alphabetically.
The next, where secret happens in the second word or second leading sub-word grouped alphabetically.
Etc.

My specific rule is that the first word is stop word it is ignored in the sorting.

Is there a way I can get solr to order my results as such?

Also, are there any drawbacks on using the solr.LetterTokenizerFactory?

I assume the maxGramSize refers to the max length of a gram and making something larger than
25 really is not helpful?

Is there a better way to do the autosuggest technique above aside from using the autocomplete3
field I've defined given what I'm trying to accomplish?

Thanks,

Neil














Mime
View raw message