[Xapian-discuss] Always returning ALL the documents matching a query

tata 668 tata668 at gmail.com
Mon Dec 29 15:39:23 GMT 2008


Thanks for the reply James.

I have to say I just begin to scratch the surface of Xapian, it seems!

I'm still a litlle bit confused. What are the diferrence between a "value", a "posting" and a 
"term"? When do I use one or the other to:

- Being able to restrict the search on multiple criterias?
I have to prefixe all the terms in the documents (all the words?) by a prefixe and then specify this 
prefixe to the queryparser before searching?

- Being able to sort the result?
I have to add "values" to the documents and then use a "sorter" to sort the documents by specifying 
which "value" to use for the sorting?


I'm really not sure. I would like to see an example of this kind of use case in the "quickstart" 
guide! :-)


The following example would be really appreciated. For a forum search page, how to:

- Index 3 forum posts (in a way that the following search is possible)
- Find which post(s) contain the phrase "hello word", have been posted by user "john doe" and have 
been created february 12th 2008.
- Return them sorted by their last modification date (may be different than the creation date) then 
by their id.


Thanks again in advance,

Julien









James Aylett wrote:
> On Mon, Dec 29, 2008 at 04:35:43AM -0500, tata 668 wrote:
> 
>> Since there are more criterias than just the indexed text, how could
>> I use Xapian without asking it to return ALL documents matching the
>> main search query?
> 
> You can add terms to your Xapian database that represent the other
> variables you want to restrict searches to. One common way of doing
> this is to use omega-style prefixed terms
> <http://xapian.org/docs/omega/termprefixes.html>, which is compatible
> with the QueryParser and TermGenerator.
> 
> J
> 



More information about the Xapian-discuss mailing list