symfony-cmf / search-bundle

UNMAINTAINED - search Bundle for the Symfony CMF project integrating with LiipSearchBundle
http://cmf.symfony.com/
8 stars 10 forks source link

sync with cmf-sandbox search_bundle branch #1

Closed dbu closed 12 years ago

dbu commented 12 years ago

just stumbled over this branch: https://github.com/symfony-cmf/cmf-sandbox/tree/search_bundle once this is done, we should probably kill that branch. meanwhile, there might be interesting stuff in it for this bundle.

lsmith77 commented 12 years ago

yeah .. i will try to work on this later this month so assigning this to me.

lsmith77 commented 12 years ago

the main issue i currently see is that imho we need to namespace properties regardless of which i18n strategy we are using so that we can properly filter nodes when using multi lingual search.

aka so that when i run the search query i can ensure that i only find matches for the language i am searching for. right now there is the problem of getting duplicate results for the same node for different languages. this will need a change in PHPCR ODM.

dbu commented 12 years ago

with the child strategy, the language is in the node name. maybe we could build the query to filter out nodes that match one of the other languages? on the other hand, this is a difficult thing because maybe you do want to find results in all languages (not duplicates of course, but when the word is only in the other languages. esepecially when a node is not translated into your language...). filtering out the duplicates afterwards is not an option?

lsmith77 commented 12 years ago

filtering them out afterwards is a mess .. especially with limit .. since you then need to fetch more then you want to then cut it down.

as for constructing the query to filter out the child nodes by node name, i don't think that is possible in jackrabbit either. jackrabbit is seriously limited in operations on the path name.

dbu commented 12 years ago

alright. well i don't see any harm in adding the locale prefix in child nodes as well, go for it. note that in AttributeTransationStrategy we have the phpcr_locale prefix and the locale as part of the attribute name (though i am confused as we seem to assume the locale is exactly 2 characters long in getLocalesFor. this should probably be reviewed and cleaned up.)

i guess for consistency you want the child strategy to use the namespace as well.

i see one more problem with the child strategy: if the non-translated fields also contain some text that matches the query, you still get duplicates. completely ignoring non-locale nodes would sound wrong again.

maybe we have to say you just need the attribute translation strategy if you want search without duplicates.

the problem might become even worse when we have pages assembled from blocks, because then there is no way to see what belongs together in the query. maybe then you really need an external search index that indexes some sort of compiled pages rather than the raw data.

lsmith77 commented 12 years ago

i have just created https://github.com/symfony-cmf/cmf-sandbox/tree/search_bundle2 using this Bundle .. doesn't handle the above noted issues with duplicate content ..

lsmith77 commented 12 years ago

@docteurklein maybe you can have a look too?

lsmith77 commented 12 years ago

closing this ticket in favor of https://github.com/symfony-cmf/cmf-sandbox/pull/100