Comments (5)
@toastdriven @acdha could you please take a look into it?
from django-haystack.
Having the same issue now, any update?
from django-haystack.
Same problem here.
from django-haystack.
Failed to query Elasticsearch using 'OR title:(pdf) OR keywords:("pdf") OR id:(pdf)) AND NOT (login_required:(True)))':
...
Can't parse boolean value [True], expected [true] or [false]
You can workaround this, if you don't like to monkeypatch. Just don't pass a boolean. Watch what is passing the boolean, in my case it was login_required
.
I changed the corresponding field to hold an integer
login_required = indexes.BooleanField(default=False) # to
login_required = indexes.IntegerField(default=0)
And the related queryset;
def prepare_login_required(self, obj):
return obj.page.login_required # to
return 1 if obj.page.login_required else 0
def get_queryset(self):
queryset = self.form.search()
if not self.request.user.is_authenticated:
queryset = queryset.exclude(login_required=True) # to
queryset = queryset.exclude(login_required=1)
return queryset
from django-haystack.
I'm also seeing an issue going in the other direction, back into bool
s in query results. Since BooleanField.convert()
just returns bool(value)
, and bool("false") == True
, all booleans are always being returned as True
.
I had to resort to subclassing BooleanField
and overriding convert()
:
from haystack.fields import BooleanField as _BooleanField
class BooleanField(_BooleanField):
def convert(self, value):
if isinstance(value, str):
return False if value.lower() in ('false', '') else True
else:
return super().convert(value)
from django-haystack.
Related Issues (20)
- When will haystack release for django 4.0+ version? HOT 14
- RemovedInDjango41Warning due to default_app_config.
- Forcing indexing to use different connection than Default - mutiple languages
- crash after updating to 3.2 (date_facet_fields is returning: TypeError: 'NoneType' object is not iterable) HOT 2
- Loss of result information in Solr range facet query
- Cannot index proxy model HOT 1
- Relation to Deepset AI Haystack
- Create new release with Django v4 and v5 support HOT 17
- AWS open search compatibility (should be quick to fix) HOT 1
- Django Haystack indexing is not working for many to many field in model
- Storing indexes in the database
- AttributeError: 'list' object has no attribute 'split' using count() method for a SearchQuerySet
- django.utils.datetime_safe module is removed in Django v5.0 HOT 8
- icontains doesn't return the correct amount. HOT 2
- Need Help: GitHub Actions tests are failing
- Django 5 deprecated datetime_safe --> Drop support for whoosh? HOT 2
- How to authenticate to Elastic cloud using API key?
- Name conflict with wagtail's update_index. TypeError: Unknown option(s) for update_index command HOT 1
- Generic view does not support the "HEAD" method.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-haystack.