Hi Guys, It is somewhat difficult to suggest something useful without more details. If you a pretty sure of the quality of the query, then here is my suggestion:
Index the documents with an extra field called "last_word" that will contains the last word in the document. So from your example below : Document 1: content=ELECTRONICS DIGITAL CAMERA, last_word=CAMERA Document 2: content=ELECTRONICS DIGITAL CAMERA BATTERY ACCESSORIES, last_word=ACCESSORIES Document 3: content=ELECTRONICS DIGITAL CAMERA 0PTICS,last_word=OPTICS Document 4: content=ELECTRONICS DIGITAL CAMERA ACCESSORIES,last_words=ACCESSORIES Document 5: content=ELECTRONICS DIGITAL CAMERA CABEL ACCESSORIES,last_words=ACCESSORIES Document 6: content=ELECTRONICS DIGITAL CAMERA OPTICS CABEL ACCESSORIES,last_words=ACCESSORIES Document 7: content=ELECTRONICS DIGITAL CAMERA APPERAL ACCESSORIES,last_words=ACCESSORIES Then, when the query looks like: "Digital Camera Optics", you can rewrite the query: "digital camera optics +last_word:optics" If this query returned nothing, then search without the term last_word:optics and sort the results by score and be length... Does that help ? Jp _______________________________________________________________________ SpeechWorks solutions from ScanSoft. Inspired Applications, Exceptional Results <Jean-Philippe Robichaud > :: Solution Speech Scientist ScanSoft :: Professional Services 5100-75 Queen Street, Montreal, QC P +1 514 843 4884 -----Original Message----- From: Karthik N S [mailto:[EMAIL PROTECTED] Sent: Monday, March 14, 2005 6:05 AM To: java-user@lucene.apache.org Subject: RE: SPECIFIC HIT Hi Guys The process is correct , but It is Impossible to have the optional terms. The Documents we Index is in millions with similar word trailers . Any other Ideas , Please advise.... Thx in advance Karthik -----Original Message----- From: sergiu gordea [mailto:[EMAIL PROTECTED] Sent: Monday, March 14, 2005 4:18 PM To: java-user@lucene.apache.org Subject: Re: SPECIFIC HIT Karthik N S wrote: >Hi Guys > >Is there a way around for which the query parser would have something like >this > > (+digital +camera +optics) -(All other Default variables) > > >But a run time Once cannot determine the default values. > >I am stuck in between for this cause ........ :(D > > You can ask the user to provide mandatory terms and optional terms and then combine the queries in a mandatory : digital camera optics optional: battery cable an then create the query: +digital +camera +optics battery cable Hope it helps even if I don't know if I undestood your problem correctly. Sergiu --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]