lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ian Lea <ian....@gmail.com>
Subject Re: Re: wild card with keyword fileld
Date Wed, 20 Jul 2005 14:15:32 GMT
Rahul

Looks like you've got the args mixed up in your qp calls.  I think it should be:

 QueryParser qp = new QueryParser("keywords",analyzer);
 qp.setLowercaseWildcardTerms(false); 
 Query query = qp.parse(line);


--
Ian.


On 20 Jul 2005 14:06:32 -0000, Rahul D Thakare
<rahul_thakare@rediffmail.com> wrote:
>  
> Erik/Ian
> 
>  I tried using query.parse(String) did't return any result
>  also my query.toString() returns mainboard:keywords  if i give the keyword as mainboard.
pls see the changed code again.
> 
>    PerFieldAnalyzerWrapper analyzer = new PerFieldAnalyzerWrapper( new StandardAnalyzer()
);
>  analyzer.addAnalyzer( "keywords", new KeywordAnalyzer() );
> 
>   QueryParser qp = new QueryParser(line,analyzer);
>   qp.setLowercaseWildcardTerms(false);
>   Query query = qp.parse("keywords");
> 
>   and
>   doc.add(Field.Keyword("keywords", "mainboard"));
> 
>   please advice if I am doing someting wrong
> 
>   regards
>   rahul...
> 
> 
> On Wed, 20 Jul 2005 Erik Hatcher wrote :
> >
> >On Jul 20, 2005, at 1:22 AM, Rahul D Thakare wrote:
> >
> >>
> >>Hi Ian,
> >>
> >>   Yes, I did implement Eric's suggestion last week, but couldn't help.
> >
> >Also, just to note it.... I did mention the parse(String) method in  the e-mail referenced
below!  :)
> >
> >     Erik
> >
> >>  I am using a demo program from Lucene.jar to test this, let me put  a code
here.
> >>
> >>   doc.add(Field.Keyword("keywords", "MAIN BOARD"));
> >>   while indexing
> >>
> >>and for retrieving
> >>
> >>  PerFieldAnalyzerWrapper analyzer = new PerFieldAnalyzerWrapper ( new StandardAnalyzer()
);
> >>  analyzer.addAnalyzer( "keywords", new KeywordAnalyzer() );
> >>
> >>/* QueryParser qp = new QueryParser(line,analyzer);
> >>   qp.setLowercaseWildcardTerms(false);
> >>   Query query = qp.parse(line, "keywords", analyzer);
> >>*/
> >>  Query query = QueryParser.parse(line, "keywords", analyzer);
> >>
> >>   you can see Eric's suggestion implemented in commented line.
> >>
> >>  am I doing something wrong here ? please let me know.
> >>
> >>   thanks and regards
> >>
> >>   Rahul Thakare..
> >>
> >>
> >>On Tue, 19 Jul 2005 Ian Lea wrote :
> >>
> >>>Have you tried Erik's suggestion from last week?
> >>>http://mail-archives.apache.org/mod_mbox/lucene-java-user/ 200507.mbox/%
3cFCE3C9A0-2707-4303-9F33-175015F02EE3@ehatchersolutions.com%3e
> >>>
> >>>There is certainly some case confusion in your examples there.
> >>>Personally, I tend to just lowercase all text on indexing and
> >>>searching.
> >>>
> >>>--
> >>>Ian.
> >>>
> >>>On 19 Jul 2005 05:31:08 -0000, Rahul D Thakare
> >>><rahul_thakare@rediffmail.com> wrote:
> >>>
> >>>>
> >>>>Hi,
> >>>>
> >>>>   I am using Field.Keyword for indexing multi-word keyword (eg:  MAIN
LOGIG). Also used keywordAnalyzer, but wild card search is  not coming up. Is there anything
which I need to do in addition  or, wild card search is not possible with keyword field.
> >>>>
> >>>>thanks and regards,
> >>>>
> >>>>Rahul Thakare..
> >>>>
> >>>>
> >>>
> >>>---------------------------------------------------------------------
> >>>To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> >>>For additional commands, e-mail: java-user-help@lucene.apache.org
> >>>
> >>
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> >For additional commands, e-mail: java-user-help@lucene.apache.org
> >
> 
>

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


Mime
View raw message