Oh my. I am basically being a total monkey. Every time I was changing my 
schema.xml to try new things out I was then reindexing our staging server's 
index instead of my local dev index so no changes were occurring locally.

Dear me. 

This is working now, surprise.

On Oct 8, 2010, at 8:53 AM, Markus Jelsma wrote:

> How come your query analyser spits out grams? It isn't configured to do so or 
> you posted an older field definition. Anyway,  do you actually search on your 
> new field?
> 
> On Friday, October 08, 2010 02:46:08 pm Allistair Crossley wrote:
>> Hi,
>> 
>> Yep, I was just looking at the analyzer jsp. The ngrams *do* exist as
>> expected, so it's not my configuration that is at fault (he says)
>> 
>> Index Analyzer
>> sh   ho      oo      ot      te      er      sho     hoo     oot     ote     
>> ter     shoo    hoot    oote    oter    shoot   
> hoote ooter
>>      shoote  hooter
>> sh   ho      oo      ot      te      er      sho     hoo     oot     ote     
>> ter     shoo    hoot    oote    oter    shoot   
> hoote oote
>> r    shoote  hooter
>> sh   ho      oo      ot      te      er      sho     hoo     oot     ote     
>> ter     shoo    hoot    oote    oter    shoot   
> hoote oote
>> r    shoote  hooter
>> sh   ho      oo      ot      te      er      sho     hoo     oot     ote     
>> ter     shoo    hoot    oote    oter    shoot   
> hoote oote
>> r    shoote  hooter Query Analyzer
>> 
>> sh   ho      oo      ot      te      er      sho     hoo     oot     ote     
>> ter     shoo    hoot    oote    oter    shoot   
> hoote ooter
>>      shoote  hooter
>> sh   ho      oo      ot      te      er      sho     hoo     oot     ote     
>> ter     shoo    hoot    oote    oter    shoot   
> hoote oote
>> r    shoote  hooter
>> sh   ho      oo      ot      te      er      sho     hoo     oot     ote     
>> ter     shoo    hoot    oote    oter    shoot   
> hoote oote
>> r    shoote  hooter
>> sh   ho      oo      ot      te      er      sho     hoo     oot     ote     
>> ter     shoo    hoot    oote    oter    shoot   
> hoote oote
>> r    shoote  hooter
>> 
>> 
>> Yet, searching either
>> 
>> /solr/select?q=hoot
>> 
>> or
>> 
>> /solr/select?q=name:hoot
>> 
>> does not yield results.
>> 
>> When searching for shooter I see 2 results with names:
>> 
>> 1. <str name="name">Shooters International Inc</str>
>> 2. <str name="name">Hong Kong Shooter</str>
>> 
>> Yours, puzzled :)
>> 
>> On Oct 8, 2010, at 8:38 AM, Jan Høydahl / Cominvent wrote:
>>> Hi,
>>> 
>>> The first thing I would try is to go to the analysis page, enter your
>>> test data, and report back what each analysis stage prints out:
>>> http://localhost:8983/solr/admin/analysis.jsp
>>> 
>>> --
>>> Jan Høydahl, search solution architect
>>> Cominvent AS - www.cominvent.com
>>> 
>>> On 8. okt. 2010, at 14.19, Allistair Crossley wrote:
>>>> Morning all,
>>>> 
>>>> I would like to ngram a company name field in our index. I have read about 
> the costs of doing so in the great David Smiley Solr 1.4 book and just to get 
> started I have followed his example in setting up an ngram field type as 
> follows:
>>>>            <fieldType name="text_substring" class="solr.TextField"
>>>>            positionIncrementGap="100" stored="false" multiValued="true">
>>>>            
>>>>                    <analyzer type="index">
>>>>                    
>>>>                            <tokenizer 
>>>> class="solr.StandardTokenizerFactory" />
>>>>                            <filter class="solr.LowerCaseFilterFactory" />
>>>>                            <filter class="solr.NGramFilterFactory" 
>>>> minGramSize="4"
>>>>                            maxGramSize="15" />
>>>>                    
>>>>                    </analyzer>
>>>>                    <analyzer type="query">
>>>>                    
>>>>                            <tokenizer 
>>>> class="solr.StandardTokenizerFactory" />
>>>>                            <filter class="solr.LowerCaseFilterFactory" />
>>>>                    
>>>>                    </analyzer>
>>>>            
>>>>            </fieldType>
>>>> 
>>>> I have restarted/reindexed everything but I still cannot search
>>>> 
>>>> hoot
>>>> 
>>>> and get back the company named Shooter. searching shooter is fine.
>>>> 
>>>> I have followed other examples on the internet regards an ngram field
>>>> type. Some examples seem to use an index analyzer that has an ngram
>>>> tokenizer rather than filter if this makes a difference. But in all
>>>> cases I am not seeing the expected result, just 0 results.
>>>> 
>>>> Is there anything else I should be considering here? I feel like I must
>>>> be very close, it doesn't seem complicated but yet it's not working
>>>> like everything else I have done with solr to date :)
>>>> 
>>>> Any guidance appreciated,
>>>> 
>>>> Allistair
> 
> -- 
> Markus Jelsma - CTO - Openindex
> http://www.linkedin.com/in/markus17
> 050-8536600 / 06-50258350

Reply via email to