for a project I would like to do partial matches.
Fir example, I have this list of names:
BozeWolf
Roel Kramer
SneeuwWitje
q = Roe
results = comp.search(q)#.prefetch()
results = results.flags(xapian.QueryParser.FLAG_PARTIAL)
This matches Roel kramer, but if I do
q = oel
it matches nothing.
q = e
matches everything
Is this the correct way to apply queryparser flags to djapian? How do
get q = oel to match Roel? A bit more flags documentation would be
usefull. Thanks in advance.
Roel Kramer
The result you've seen is Xapian feature. Partial search only matches
from beginning of the word -- that's why you can search 'Roe' but
cannot 'oel'. And one char search term like 'e' is also the specific
Xapian behavior allows to match distinct chars.
So it is not the Djapian issue.
---
Alex Koshelev
> --
> You received this message because you are subscribed to the Google Groups "Djapian Users" group.
> To post to this group, send email to djapia...@googlegroups.com.
> To unsubscribe from this group, send email to djapian-user...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/djapian-users?hl=en.
>
>
I understand the searching flags are features of xapian, but I still do
not understand where to apply these search flags. In the message below i
did it like so:
1: q = Roe
2: results = comp.search(q)#.prefetch()
3: results = results.flags(xapian.QueryParser.FLAG_PARTIAL)
Is it correct to pass flags to results on line 3? It seems to work, but
it looks a bit strange to apply flags to search results.
thanks,
Roel
---
Alex Koshelev
Yep, it is the correct usage. The ResultSet objects are lazy (just
like QuerySets in Django) and only evaluated when you iterate over it.
Before that you can customize search by adding flags, filter and so
on.---
Alex Koshelev
> Thanks for the answer,