How to achieve wildcard search using haystack in django

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to achieve wildcard search using haystack in django

shawnmhy

I am currently working on haystack search in django. I met 2 problems, first, when I use 'Whoosh' engine, the search can only return the result that match exactly the same with my search key, for example if I type 'ABC', it cannot match 'ABCD' Secondly, how can I achieve wildcard search using haystack? For example, if I type'A*C', it can return 'ABC', 'ABCCC' 'AC' and so one. Or other method just to achieve the same result(Basically, return the result that contains the key word in same order)


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/f13fe857-13c9-4d46-b1f8-9f8d42298dae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to achieve wildcard search using haystack in django

Gabriel - Iulian Dumbrava
Please note that there are a few considerations when using wildcards.
First, there are some issues with haystack and woosh, as the one here. Wildcards work by default with autosearch, otherwise you'll have to compile the query yourself.

On the other hand, you must consider the backend haystack uses. I haven't used Whoosh recently, but I know that other backends, like solr, for example uses by default a minimum of 3 character 'groups' when generating search items, so it may also be the case that the search you are doing does not fall into any of those groups.

marți, 10 aprilie 2018, 22:28:29 UTC+3, [hidden email] a scris:

I am currently working on haystack search in django. I met 2 problems, first, when I use 'Whoosh' engine, the search can only return the result that match exactly the same with my search key, for example if I type 'ABC', it cannot match 'ABCD' Secondly, how can I achieve wildcard search using haystack? For example, if I type'A*C', it can return 'ABC', 'ABCCC' 'AC' and so one. Or other method just to achieve the same result(Basically, return the result that contains the key word in same order)


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/f36e2281-bd1f-48e8-8b77-ca655f7a16a8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.