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

Olly Betts olly at survex.com
Tue Jan 6 23:19:07 GMT 2009


On Mon, Dec 29, 2008 at 04:35:43AM -0500, tata 668 wrote:
> Xapian's job is currently to return the ids of the posts in which the
> body text contains the main search query. Then I would join those ids
> with the other criterias specified by the user in a SQL query, using
> something like "WHERE id IN(1,2,3) AND otherCriterias", where "1,2,3"
> would be the ids returned by Xapian. This could result in a big query
> (a lot of ids in the "IN" part of the query) but at least it works.
> 
> 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 apply an external filter (such as one from an SQL query) during
the match process using Xapian::PostingSource, but it's only in SVN
trunk currently:

http://trac.xapian.org/browser/trunk/xapian-core/docs/postingsource.rst

Cheers,
    Olly



More information about the Xapian-discuss mailing list