dcsimg
getting all documents from a boolean query/ weighted,with limit
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Tony_Crisera
Posted On:   Friday, June 30, 2006 07:30 AM

Hi, I'm pretty new to Lucene and would appreciate some direction. Sorry if this is a repost, I tried yesterday, but that doesn't appear I am creating an index with documents that have a bunch of fields from a database view. For searching there is a web page that presents a number of checkboxes, dropdowns, and keyword field. I am using term queries added to a boolean query with BooleanClause.Occur.SHOULD for all criteria selected. What I want is a hit list with documents with the most matching criteria at the top. i.e. 2 matching fields, followed by 1 matching field, followed by 0. I also want to limit the hit list to a maximum number of docs. The problem is if the user enters no criteria and submits, I still want to return    More>>

Hi, I'm pretty new to Lucene and would appreciate some direction. Sorry if this is a repost, I tried yesterday, but that doesn't appear


I am creating an index with documents that have a bunch of fields from a database view. For searching there is a web page that presents a number of checkboxes, dropdowns, and keyword field. I am using term queries added to a boolean query with BooleanClause.Occur.SHOULD for all criteria selected.

What I want is a hit list with documents with the most matching criteria at the top. i.e. 2 matching fields, followed by 1 matching field, followed by 0. I also want to limit the hit list to a maximum number of docs.

The problem is if the user enters no criteria and submits, I still want to return documents. Right now I get hits for any criteria I add that has a match, but nothing more. I'm not sure how the SHOULD is supposed to work for a boolean clause.

Any help is appreciated. Thanks, -TC

   <<Less

Re: getting all documents from a boolean query/ weighted,with limit

Posted By:   Dejan_Nenov  
Posted On:   Monday, July 3, 2006 01:15 PM

This can also be a UI problem. Take a look at the demo here adn see if it works for you. https://salesforce.maketime.com

Re: getting all documents from a boolean query/ weighted,with limit

Posted By:   Otis_Gospodnetic  
Posted On:   Saturday, July 1, 2006 11:33 AM

If you want the users to be able to enter nothing and still get documents back, then you are not really doing a search, which means you should not be using Lucene for this.
If you insist on using Lucene for this, you will need to add an additional field to your Lucene Documents, and have that field with a fixed value.
e.g.
myfield=myvalue

Then, if user enters nothing, do a search for myfield:myvalue and you will get back ALL your documents from the index.
About | Sitemap | Contact