lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Lamprecht" <clampre...@gmail.com>
Subject Re: MultiFieldQueryParser Search On C++ problem
Date Fri, 16 Jun 2006 17:25:26 GMT
It's the Analyzer you're passing into the QueryParser.
StandardAnalyzer turns "C++" into "c".  You can change the .jj grammar
to fix this.  (same for "C#")

On 6/14/06, Joe Amstadt <tekkacon@yahoo.com> wrote:
> I'm trying to do a search on ( Java PHP C++ ) with
> lucene 1.9.  I am using a MultiFieldQueryParser to
> parse with StandardAnalyzer. Before I parse the string
> I clean up the search string and it looks like this (
> Java PHP C\+\+ ).  The query is only searching on "c"
> and not "c++" any ideas as to what I am doing wrong at
> this point would be great.
>
> MultiFieldQueryParser mfqp = new
> MultiFieldQueryParser( str_arr_fields, analyzer );
>
> try{
>
>         System.out.println( "String Before Clean Up --> " +
> str_search_value );
>         String str_clean_search = stringCleanUp(
> str_search_value );                             //Escape these special chars +
> - && || ! ( ) { } [ ] ^ " ~ * ? : \
>         System.out.println( "String After Clean Up --> " +
> str_clean_search);
>         Query query = mfqp.parse( str_clean_search );
>         System.out.println( "Search Query --> " +
> query.toString() );
>         bq_query.add( query, BooleanClause.Occur.MUST );
>
> }catch( ParseException pe_error ){
>
>         pe_error.printStackTrace();
> }
>
> output:
>
> String Before Clean Up --> Java PHP C++
> String After Clean Up --> Java PHP C\+\+
> Search Query --> ( search_text:java title:java ) (
> search_text:php title:php ) ( search_text:c title:c )
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> 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