Questions tagged [searchqueryset]

37 questions
3
votes
1 answer

Merge multiple SearchQuerySet

I use Haystack and solr for a global search with multiple models , i try to use different filter on models, but at the end i have to return 1 queryset, i don't find how to merge this. #views from haystack.generic_views import SearchView class…
V1ce
  • 63
  • 8
3
votes
1 answer

How to filter results using django-haystack SearchQuerySet?

I'm attempting to use django-haystack + whoosh in my Django application. My index class looks like this class ArticleIndex(indexes.SearchIndex, indexes.Indexable): text = indexes.CharField(document=True, use_template=True) title =…
2
votes
1 answer

What is the difference between using __exact and Exact()?

I am using Solr search for Django application using Haystack. In order to get more precise result, I had to change the search query to perform exact search - from haystack.query import SearchQuerySet, SQ from haystack.inputs import Exact .... query…
Mutant
  • 2,959
  • 3
  • 29
  • 52
2
votes
1 answer

Union of 2 SearchQuerySet in django haystack

Is there any way to get an union of two or more searchqueryset ? For example :- query1 = SearchQuerySet().filter(authors=query) query2 = SearchQuerySet().filter(title=query) How do I combine both the queries together so that i get a union of the 2…
2
votes
2 answers

Django Haystack with elasticsearch returning empty queryset while data exists

I am doing a project in Python, django rest framework. I am using haystack SearchQuerySet. My code is here. from haystack import indexes from Medications.models import Salt class Salt_Index(indexes.SearchIndex, indexes.Indexable): text =…
Ashok Joshi
  • 377
  • 3
  • 10
2
votes
1 answer

How can I filter SearchQuerySet results based on a specifice model and an ID

This is the model, in which I want to search class itemType(models.Model): partNumber = models.CharField(max_length = 12, null = True) designation = models.CharField(max_length = 200, null = True) timeCreate = models.DateTimeField() #auto…
eljobso
  • 304
  • 1
  • 6
  • 19
2
votes
1 answer

haystack SearchQueryResult object returns multiple objects

I don't get why get() with pk=1 would result in multiple objects returned below.. sqs = SearchQuerySet().more_like_this(self) for obj in sqs: do something with obj.object # obj.object results in error get() returned more than one MyModel --…
eugene
  • 33,301
  • 47
  • 188
  • 382
1
vote
1 answer

How to make a search query in MongoDB

I have profiles in a collection called Profiles. I am making the query to search profiles based on user provided fields. Searching Form(UI Form), User have different options to search profiles like 'female' or 'male' or 'Any' and click on Search…
M.Shahid
  • 13
  • 3
1
vote
0 answers

Making Django-haystack autocomplete suggestions work for accented query (à, é, ï, etc..)

I'm trying to make the suggestions from Django-haystack' autocomplete to be sensitive to words containing accents. (For french language) Current result: User type Seville Output suggestion returns nothing because the actual destination name is…
locq
  • 201
  • 4
  • 17
1
vote
1 answer

Add additional fields after phone number lookup in the database in Django

I am building an app that look for each phone number in the database. If there is any duplicate, I want to grab the first phone number found as the main record for that phone number, then for the duplicate information(name, location), get each one…
1
vote
1 answer

Filtering drf-haystack results by current user

I'm currently using Django 1.10.3, django-haystack search engine with elasticsearch backend, and drf-haystack to prove the views. The searches in general have been great, but I am completely unable to filter results by current user. The index…
1
vote
2 answers

How to get n search objects from a SearchQuerySet without changing the type?

I am trying to get the to 10 objects like : q_auth = SearchQuerySet().filter(content=validate_query) q_auth = q_auth[:10] print type(q_auth) The output I want is: but I am getting is . Can some…
1
vote
1 answer

Intersection of two SearchQuerySets in Django

So I have a similar model: class Whatever(SlugMixin, models.Model): user = models.ForeignKey(auth_models.User, related_name='user+', verbose_name=_('User'), on_delete=models.PROTECT) name = models.CharField(verbose_name=_('Name'),…
elena
  • 2,820
  • 4
  • 19
  • 32
1
vote
1 answer

Django Haystack SearchQuerySet order_by returning no results

I have Haystack working in "Old urls.py" below. When I try to order my search results using order_by on the model field 'canonical_school_score', as seen in "New urls.py," I keep getting no search results. Any suggestions on what I'm doing wrong? #…
wsvincent
  • 197
  • 3
  • 12
1
vote
1 answer

Wordpress complex search query into pretty permalinks

I just wondering if there is a way to convert Wordpress complex search query into pretty permalinks. From what I understand, there is a way to convert: www.domain.com/?s=keyword into www.domain.com/search/keyword However, what if you want to change…
1
2 3