FAQ
Hi.
I am newbie to lucene.

I have a query to search for a salespersonid and whose contactfirstname is
firstname* and whose whose contactlast name is lastname*
so firstname can be chr* and lastname can be chr* --> so the below query is
retrieving me results chris christopher
QueryParser parser = new QueryParser(SALES_PEOPLE, new StandardAnalyzer());
query = parser.parse(salesPersonID + " AND CONTACT_FIRST_NAME:" + firstname+
"*"+" AND CONTACT_LAST_NAME:" + lastname+ "*" );

now i need to modify the query to fetch results like below
firstname can be and* or chri* or emi*
lastname can be and* or chri* or emi*

Please help me how to modify the query to achieve the above results .
basically how to include both and and or conditions in my query

--
View this message in context: http://www.nabble.com/Lucene-2.4.1-query-tp25531130p25531130.html
Sent from the Lucene - Java Developer mailing list archive at Nabble.com.


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

Search Discussions

  • Luis Alves at Sep 24, 2009 at 4:52 pm
    Hi sailaja,

    Please post your question to java-user mailing list.
    This is not the correct mailing list.

    sailaja balaraju wrote:
    Hi.
    I am newbie to lucene.

    I have a query to search for a salespersonid and whose contactfirstname is
    firstname* and whose whose contactlast name is lastname*
    so firstname can be chr* and lastname can be chr* --> so the below query is
    retrieving me results chris christopher
    QueryParser parser = new QueryParser(SALES_PEOPLE, new StandardAnalyzer());
    query = parser.parse(salesPersonID + " AND CONTACT_FIRST_NAME:" + firstname+
    "*"+" AND CONTACT_LAST_NAME:" + lastname+ "*" );

    now i need to modify the query to fetch results like below
    firstname can be and* or chri* or emi*
    lastname can be and* or chri* or emi*

    Please help me how to modify the query to achieve the above results .
    basically how to include both and and or conditions in my query

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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupjava-dev @
categorieslucene
postedSep 23, '09 at 1:17p
activeSep 24, '09 at 4:52p
posts2
users2
websitelucene.apache.org

2 users in discussion

Sailaja balaraju: 1 post Luis Alves: 1 post

People

Translate

site design / logo © 2021 Grokbase