Comments (4)
Hi sant527, I think in your case it'd make sense to use model inheritance.
You'd create a BabyThing
class BabyThing(model.Model):
name = ...
description = ...
class BabyDoctor(BabyThing):
.... other fields not common
class BabyStore(BabyThing):
.... other fields not common
class BabySitter(BabyThing):
.... other fields not common
Then just setup indexing for BabyThing
model.
from algoliasearch-django.
How to create facets in this case
from algoliasearch-django.
Hey @sant527 sorry for the late reply. I've ready your other issue #321
I want to put several modes in singel index. Then only i can make use of facets
like i have models for store, item etc
I want a single index for searching anything store or item.
So i want to add some category and put thesemodels in same index.
How can i do this
I'm not entirely sure what would prevent you from creating facets in this case. Once you data is indexed, you should be able to create a facet.
If you BabyThing parent models has a category
field, it should be indexable and configurable as a facet.
class BabyThing(model.Model):
name = ...
description = ...
category = models.CharField(max_length=30)
Then you'll be able to create:
BabySitter(name="Suzy", description="...", category="3-5yo")
BabyStore(name="The awesome store", description="...", category="3-5yo")
Can you elaborate on the problem you're facing with this appoarch ?
BTW, I'll close #321 to continue the discussion here.
from algoliasearch-django.
I'll close this issue. Happy to investigate this again after you elaborate on the problem you're facing with my approach. Feel free to reopen then.
from algoliasearch-django.
Related Issues (20)
- Algolia reindex script tmp index move takes a long time. HOT 1
- Auto camel casing with Graphene HOT 1
- register decorator not working HOT 2
- disable indexing decorator not working HOT 2
- Relies on stale version of Algolia Python library HOT 4
- How to sorted replicas_index dynamic? HOT 3
- Containerize repository
- algoliasearch v1.20.0 still targeted as a dependency HOT 2
- Auto indexing when related model is changed HOT 3
- upon reindexing the main index overwrites its replica configurations - this behaviour should made configurable as it might be undesired
- which version start supporting django32 HOT 1
- Unknown command: 'algolia_reindex' HOT 1
- How to put several models in one index HOT 1
- Preserve field names after preprocessing a field
- Support Multiple Algolia applications in one Django project
- Mapping Django and Algolia fields name
- Python 3.11 Support HOT 1
- Add support for Django 4.x series HOT 2
- Indexing take too much memory
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 algoliasearch-django.