lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Valdivia <h...@danielvaldivia.com>
Subject Re: EdgeNGramFilterFactory not working? Solr 5.3.1
Date Tue, 17 Nov 2015 23:37:49 GMT
Hi Alexandre,

Thanks for your prompt response, I already did most of the analysis before

Specifying the dispNamePrefix on the q  parameter like you suggest does yield results, some
undesirable but I think it might be because I have the EdgeNGramFilterFactory in my query
analyzer

http://localhost:8983/solr/superCore/select?q=dispNamePrefix%3Ainci&wt=json&indent=true
<http://localhost:8983/solr/superCore/select?q=dispNamePrefix:inci&wt=json&indent=true>

this query returns matches like "Module Inclusion" for the dispNamePrefix:inci query, so I
guess the subset "inc" is matching this result, so I changed my field type, removed the core
and started again (create core, add field type, fields, etc) and now the same query matches
nothing, I'm confused since the analysis screen does make sense

attached screenshot of the analysis 






> On Nov 17, 2015, at 3:25 PM, Alexandre Rafalovitch <arafalov@gmail.com> wrote:
> 
> Here would be my debugging sequence:
> 
> 1. Are you actually searching against: dispNamePrefix (and not against
> the default text field which has its own analyzer stack)?
> 2. Do you see the field definition in the Schema Browser screen?
> 3. If you on that screen, click "Load Term Info" do you see the partial terms?
> 4. If you go to the Analysis screen, you should be able to select the
> field (or the type) from the drop-down and put both text to index and
> text to search and see what happens to them and whether they match.
> 
> Regards,
>   Alex.
> ----
> Newsletter and resources for Solr beginners and intermediates:
> http://www.solr-start.com/
> 
> 
> On 17 November 2015 at 18:17, Daniel Valdivia <hola@danielvaldivia.com> wrote:
>> Hi,
>> 
>> I'm trying to get the EdgeNGramFilterFactory filter to work on a certain field, however
after defining the fieldType, creating a field for it and copying the source, this doesn't
seem to be working.
>> 
>> One catch here, that I'm not sure if it's affecting the outcome is that none of my
fields are stored, everything but the document id in my index is stored=false
>> 
>> I'm using Solr 5.3.1, and I know in my corpus the word "incident" is present, I can
search for it, but looking for "inci" yields no results
>> 
>> http://localhost:8983/solr/superCore/select?q=inci&fl=record_display_name&wt=json&indent=true
>> 
>> Any idea on what could I be doing wrong?
>> 
>> This is how I define the field type
>> 
>> {
>>  "add-field-type" : {
>>    "indexed" : true,
>>    "queryAnalyzer" : {
>>      "filters" : [
>>        {
>>          "class" : "solr.LowerCaseFilterFactory"
>>        }
>>      ],
>>      "tokenizer" : {
>>        "class" : "solr.WhitespaceTokenizerFactory"
>>      }
>>    },
>>    "indexAnalyzer" : {
>>      "filters" : [
>>        {
>>          "class" : "solr.LowerCaseFilterFactory"
>>        },
>>        {
>>          "class" : "solr.EdgeNGramFilterFactory",
>>          "minGramSize" : "2",
>>          "maxGramSize" : "10"
>>        }
>>      ],
>>      "tokenizer" : {
>>        "class" : "solr.WhitespaceTokenizerFactory"
>>      }
>>    },
>>    "stored" : false,
>>    "name" : "prefix",
>>    "class" : "solr.TextField"
>>  }
>> }
>> 
>> Adding the field
>> 
>> {
>>  "add-field":{
>>     "name":"dispNamePrefix",
>>     "type":"prefix",
>>     "stored":false }
>> }
>> 
>> Copy field
>> 
>> {
>>  "add-copy-field":{
>>     "source":"record_display_name",
>>     "dest":[ "dispNamePrefix"]}
>> }


Mime
View raw message