Djapian - filtering results?

I went through its source and found that Djapian has a filter method that can be applied to its results. I have just tried the below code and it seems to be working My indexer is as follows: class MarketIndexer( djapian. Indexer ): fields = 'name', 'description', 'tags_string', 'state' tags = ('state', 'state'), Here is how I filter results (never mind the first line that does stuff for wildcard usage): objects = model.indexer.

Search(q_wc). Flags(djapian.resultset.xapian.QueryParser. FLAG_WILDCARD).prefetch() objects = objects.

Filter(state=1) When executed, it now brings Market s that have their state equal to "1.

I went through its source and found that Djapian has a filter method that can be applied to its results. I have just tried the below code and it seems to be working. My indexer is as follows: class MarketIndexer( djapian.

Indexer ): fields = 'name', 'description', 'tags_string', 'state' tags = ('state', 'state'), Here is how I filter results (never mind the first line that does stuff for wildcard usage): objects = model.indexer. Search(q_wc). Flags(djapian.resultset.xapian.QueryParser.

FLAG_WILDCARD).prefetch() objects = objects. Filter(state=1) When executed, it now brings Markets that have their state equal to "1".

I don't know Djapian, but I am familiar with xapian. In Xapian you can filter the results with a MatchDecider. The decision function of the match decider gets called on every document which matches the search criteria so it's not a good idea to do a database query for every document here, but you can of course access the values of the document.

For example at ubuntuusers. De we have a xapian database which contains blog posts, forum posts, planet entries, wiki entries and so on and each document in the xapian database has some additional access information stored as value. After the query, an AuthMatchDecider filters the potential documents and returns the filtered MSet which are then displayed to the user.

If the decision procedure is as simple as somefield.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions