lucenenet-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leonardo Azize Martins <laz...@gmail.com>
Subject Re: QueryParser
Date Wed, 26 May 2010 16:33:57 GMT
I am using the "StandardAnalyzer".
But it is a bug or it is normal?
Because "3472_003_Executa_Carga.sql" contains many others "_" and the
analyzer removes only one.
Regards


2010/5/26 Robert Jordan <robertj@gmx.net>

>  On 26.05.2010 16:36, Leonardo Azize Martins wrote:
>
>> Hello,
>>
>> I have and index with this struct:
>> new Field(LuceneFactory.ID, file.FullName, Field.Store.YES,
>> Field.Index.NOT_ANALYZED_NO_NORMS);
>> new Field(LuceneFactory.CONTENTS, plainText, Field.Store.YES,
>> Field.Index.ANALYZED, Field.TermVector.WITH_POSITIONS_OFFSETS);
>> new Field(LuceneFactory.FULLNAME, file.FullName.ToLower(), Field.Store.NO<http://field.store.no/>
>> ,
>> Field.Index.NOT_ANALYZED_NO_NORMS);
>> new Field(LuceneFactory.FILENAME, file.Name.ToLower(), Field.Store.NO<http://field.store.no/>
>> ,
>> Field.Index.NOT_ANALYZED_NO_NORMS);
>> new Field(LuceneFactory.EXTENSION, fileExtension, Field.Store.NO<http://field.store.no/>
>> ,
>> Field.Index.NOT_ANALYZED_NO_NORMS);
>> new NumericField(LuceneFactory.SIZE, Field.Store.YES,
>> true).SetLongValue(file.Length);
>>  I am using this search:
>> extension:sql AND filename:3472_003_Executa_Carga.sql
>> (note: threre is no space in 3472_003_Executa_Carga.sql)
>>
>> When I use parser method, Query object looks like:
>> {+extension:sql +filename:"3472_003_executa carga.sql"}
>>     [Lucene.Net.Search.BooleanQuery]: {+extension:sql
>> +filename:"3472_003_executa carga.sql"}
>>     boost: 1.0
>> note a space between "executa" and "carga".
>>
>> Why? Am I doing anything wrong?
>>
>
> QueryParser is using an analyzer itself while parsing the
> query, and this analyzer seems to be be stripping the "_"
> for some reasons. Which analyzer are you using?
>
> Robert
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message