Anyone can help me? It really does not work...
среда, 19 марта 2014 г., 2:05:49 UTC+7 пользователь Alexey Bagryancev
написал:
>
> Hi,
>
> I am trying to filter moreLikeThis results by adding additional query -
> but it seems to ignore it at all.
>
> I tried to run my ignoreQuery separately and it works fine, but how to
> make it work with moreLikeThis? Please help me.
>
> $ignoreQuery = $this->IgnoreCategoryQuery('movies')
>
>
>
> $this->resultsSet = $this->index->moreLikeThis(
> new \Elastica\Document($id),
> array_merge($this->mlt_fields, array('search_size' => $this->
> size, 'search_from' => $this->from)),
> $ignoreQuery);
>
>
>
> My IgnoreCategory function:
>
> public function IgnoreCategoryQuery($category = 'main')
> {
> $categoriesTermQuery = new \Elastica\Query\Term();
> $categoriesTermQuery->setTerm('categories', $category);
>
> $categoriesBoolQuery = new \Elastica\Query\Bool();
> $categoriesBoolQuery->addMustNot($categoriesTermQuery);
>
> return $categoriesBoolQuery;
> }
>
>
>
--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/212ca5d9-4c48-476d-9ea1-983b9578e8f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.