Re: Search for Java Programming vs Java Programming

2007-09-18 Thread Erik Hatcher

On Sep 18, 2007, at 7:14 AM, Dilip.TS wrote:



Hi,

 I have the following requirement:
 When the user searches for the keyword say Java Programming ,  the  
user
should be shown the results satisfying the condition Java AND  
Programming.
 But when he types Java Programming (i.e within double quotes),  
the user
should be shown with the results exactly matching Java Programming  
as a

single word (similar to doing a search on google).
 The user should be shown with the proper results accordingly.
 Any help would be highly appreciated.


Dilip - are you seeing results indicating a problem with this in your  
application?   Query syntax is spelled out in more detail here:


 http://wiki.apache.org/solr/SolrQuerySyntax

The one difference you may have is  solrQueryParser  
defaultOperator=OR/ in schema.xml.  Change that to AND to  
satisfy your first requirement.


Erik




RE: Search for Java Programming vs Java Programming

2007-09-18 Thread Dilip.TS
Hi,
 The first requirement works fine for me, but i was unaware of the Phrase
Queries for the second one.

 I found this link very much useful regarding the same.
http://wiki.apache.org/solr/SolrRelevancyCookbook

  Thanks for the help guys,

Regards
Dilip

-Original Message-
From: Erik Hatcher [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 18, 2007 6:29 PM
To: solr-user@lucene.apache.org
Subject: Re: Search for Java Programming vs Java Programming


On Sep 18, 2007, at 7:14 AM, Dilip.TS wrote:


 Hi,

  I have the following requirement:
  When the user searches for the keyword say Java Programming ,  the
 user
 should be shown the results satisfying the condition Java AND
 Programming.
  But when he types Java Programming (i.e within double quotes),
 the user
 should be shown with the results exactly matching Java Programming
 as a
 single word (similar to doing a search on google).
  The user should be shown with the proper results accordingly.
  Any help would be highly appreciated.

Dilip - are you seeing results indicating a problem with this in your
application?   Query syntax is spelled out in more detail here:

  http://wiki.apache.org/solr/SolrQuerySyntax

The one difference you may have is  solrQueryParser
defaultOperator=OR/ in schema.xml.  Change that to AND to
satisfy your first requirement.

Erik



Re: Search for Java Programming vs Java Programming

2007-09-18 Thread Venkatraman S
[ Kindly do try before posting in the forum or atleast try to look into the
wiki and other resources ]

nwayz...

For the Former:
use 'AND' and in the default query

For the latter :
use phrase queries - enclosing within double quotes should work.

On 9/18/07, Dilip.TS [EMAIL PROTECTED] wrote:


 Hi,

 I have the following requirement:
 When the user searches for the keyword say Java Programming ,  the user
 should be shown the results satisfying the condition Java AND Programming.
 But when he types Java Programming (i.e within double quotes), the user
 should be shown with the results exactly matching Java Programming as a
 single word (similar to doing a search on google).
 The user should be shown with the proper results accordingly.
 Any help would be highly appreciated.

 Thanks in advance,

 Regards,
 Dilip TS




--