lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From iouli.golova...@group.novartis.com
Subject Re: Concatinated search string in not working!
Date Mon, 06 Sep 2004 14:13:07 GMT

Thanks Erik,

will try to play with it



                                                                                         
                                             
                      Erik Hatcher                                                       
                                             
                      <erik@ehatchersol        To:       "Lucene Users List" <lucene-user@jakarta.apache.org>
                         
                      utions.com>              cc:                                    
                                                
                                               Subject:  Re: Concatinated search string in
not working!                                
                      03.09.2004 16:34                                                   
                                             
                      Please respond to        Category:       |-------------------------|
                                            
                      "Lucene Users                            | ( ) Action needed       |
                                            
                      List"                                    | ( ) Decision needed     |
                                            
                                                               | ( ) General Information |
                                            
                                                               |-------------------------|
                                            
                                                                                         
                                             
                                                                                         
                                             




The "Keyword"-ness of a field is only at indexing time, and not
something known about at query time.

You need to use a different analyzer for that field.  Check out posts
on KeywordAnalyzer and PerFieldAnalyzerWrapper - this combination is
the secret :)

             Erik



On Sep 3, 2004, at 9:55 AM, iouli.golovatyi@group.novartis.com wrote:

>
> Trying to search by two fields I got nothing.
>
> The fields where  created like:
>
> String provider =....
> doc.add(Field.Keyword("provider", provider));
> ...
> InputStreamReader input = new InputStreamReader( new
> ByteArrayInputStream(
> document.add(Field.Text("contents", input ));
>
> Searching code looks like:
>
>
> ...
>    public class NeisQueryParser extends QueryParser{
NeisQueryParser(){
PorterStemAnalyzer is used
>       }
>     }
>    ...
>    line= "Diovan and provider:NewsEdge";
>
>    NeisQueryParser nqp=new NeisQueryParser();
>    if (and) nqp.setOperator(NeisQueryParser.DEFAULT_OPERATOR_AND);
>    else     nqp.setOperator(NeisQueryParser.DEFAULT_OPERATOR_OR);
>    Query query = nqp.parse(line);
>
>    hits = ms.search(query, getCurrentTimeFilter());
>
> The parsing query  comes like
>
> +contents:diovan +provider:newsedg
>
> what I realy not undestand, because the "provider" field should not be
> tokenized.
>
> In case the line ="Diovan" I see results. Provider field I see as well
> containing  "NewsEdge".
>
> What I do wrong? Please help.
>
> J.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org







---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Mime
View raw message