Comments (9)
You can. I'll add an example as soon as possible.
from search.
Thank you very much! Could we expect the example soon?
from search.
So you cannot use the Doctrine ORM paginator because it is specific to the ORM. However i added an example for Pagerfanta and it is possible to use Zend Paginator or other generic pagination libraries in the same way.
from search.
Also another fork talkspirit@6ca22d9 has a paginator implementation but i'm not sure if it's necessary given that there are third party pagination libraries available.
from search.
Thank you very much for the example! I use Zend Framework 2 and MySQL database. Some of the searchable data is synchronized in ES. As far as I understand, I need to add all fields, which are used for filtering the data in ES too and make the filtering via the DoctrineSearch query, used in my Zend Paginator Adapter, not in the underlying Doctrine query, used for hydration the results, is this correct? Now the filtering conditions are in the Doctrine query, but if the paginator adapter uses the DoctrineSearch query it doesn't seem correct any more.
Thank you in advance for your help!
from search.
OK if you are using ES only for searching in combination with MySQL you can use the Doctrine\Search\Query::hydrateWith($doctrineQuery)
technique as shown in the docs. This will select the items from your mysql database by id. In this case you can set source=false
in your ElasticSearchable
annotation.
If your results are different from doing a query on MySQL, then this is likely because ES has different techniques for storing tokens and doing queries. Have you checked your mappings and analyzers configuration in ES? Also the type of ES search query will vary results, e.g. Match, MultiMatch etc.
from search.
Yes, I am using ES only for searching and basically the data, needed for a full text search is currently synchronized with ES. I am using the Doctrine\Search\Query::hydrateWith($doctrineQuery)
method. It seems to work fine.
My question is about the extra parameters I need to add to the query to filter the full text search results, returned from ES.
For example let's have Image
with title and description. Title and description are in ES and are used for full text search. But the image has also isActive
property and Creator
, who has isActive
property. I need to filter the ES results and get only the images which have isActive = true
and Creator
with isActive = true
. These properties are not in ES but are added as Where conditions in the Doctrine hydration query.
Image
and Creator
have also other properties, needed for filtering the full text search results. Should I add them all in ES and filter the results in ES via the Elastica query, but not in MySQL with the Doctrine hydration query?
from search.
Since ES is doing your search job for you you should sync your Image
and Creator
properties to ES also and use the correct ES query to do all the search work, then simply use the ORM lookup hydration query as provided. In this case isActive
could be type="boolean"
and Creator
type="string" index="not_analyzed"
if it is an ID.
from search.
Great, thank you very much! It was important to clarify that it's not correct to use the Doctrine hydration query for additional filtering of the search results.
Have a nice day!
from search.
Related Issues (20)
- Add support for "attachment" type
- Add support for "ip" type
- Support for "null_value" field attribute
- Support for "term_vector" field attribute
- Support for root object type mapping
- Support for Update API HOT 3
- Use filtered queries instead of setFilter() in ElasticSearch client
- Remove implementation of ZendLucene
- Neo4j support? HOT 2
- Refactoring annotations into more specific 'types' HOT 1
- Implement XML mapping support
- FOSElasticaBundle overlap? HOT 3
- Are there any contributing guidelines ? HOT 1
- Specifying the index HOT 7
- Status updates? HOT 3
- The annotation does not exist, or could not be auto-loaded. HOT 1
- Get `hits` for the query HOT 1
- Project still alive? HOT 4
- Delete from Query, Elastica dependencies. HOT 2
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 search.