Refactor thesaurus query build

- Look for text nodes and infer the concepts behind term using thesaurus
- Use value objects for thesaurus terms and concepts
- Pass a QueryContext holding allowed fields and locales informations when building the Elasticsearch query
- Change type hinting and name of query building method on nodes
- Remove unused method Node#isFullTextOnly()
- Move getFieldsStructure from RecordIndexer to RecordHelper for reusing field structure in SearchEngine
This commit is contained in:
Mathieu Darse
2015-01-15 20:04:46 +01:00
parent f283bf01d1
commit dc2c9f8c7f
21 changed files with 391 additions and 267 deletions

View File

@@ -23,19 +23,9 @@ class Query
return $this->root->getTextNodes();
}
/*
* This method seems weird to me, the implementation returns true when the
* query doesn't contain IN statements, but that doesn't define a full text
* search.
*/
public function isFullTextOnly()
public function build(QueryContext $context)
{
return $this->root->isFullTextOnly();
}
public function getElasticsearchQuery($fields = array())
{
return $this->root->getQuery($fields);
return $this->root->buildQuery($context);
}
public function dump()