Commit Graph

12 Commits

Author SHA1 Message Date
Thibaud Fabre
299b24d4fb Update class for mapping type constants 2016-10-19 13:31:17 +02:00
Mathieu Darse
6913d67e9a Convert dates to date ranges on timestamp keys 2015-11-13 19:28:59 +01:00
Mathieu Darse
d6a44c8a52 Lower-level API to build concept queries
Removes wrapPrivateFieldConceptQueries().
The goal is to wrap text and concept queries with a single call to wrapPrivateFieldQueries().
2015-08-26 19:29:26 +02:00
Mathieu Darse
c596914ab9 Fix concept query builder & private field wrapping
Concept queries on private fields where adding a « must » clause to
restrict match on certain collections only. Boolean queries do not
enforce one « should » clause match at least once a « must » clause is
added to it.
To make queries on private fields more robust & performants, these are
now wrapped in a filtered query with a collection filter.
2015-08-26 15:21:02 +02:00
Mathieu Darse
a31442368b Fix number field search
Search with non numeric content will not hit number field (it breaks elasticsearch and is useless anyway)

- Rename QueryHelper::buildPrivateFieldQueries() to wrapPrivateFieldQuery().
    - Signature changed too, the third parameter is dropped an QueryContext is replaced by an array of Field.
    - Query builder closure is now passed an array of Field, not of index field names.
- Remove Field::toConceptPathIndexFieldArray() because method name was beyond understanding (and also because it wasn't needed anymore)
- Various AST node types have changed due to previous API changes
2015-07-23 17:39:11 +02:00
Mathieu Darse
daea7f8c77 Raw queries do not localize fields anymore 2015-07-17 15:58:39 +02:00
Mathieu Darse
44cb5824e7 Implement private fields on range an equal nodes
New QueryContext::get() method
Removed QueryContext::normalizeField(), can be replaced with get() and a call to
Field::getIndexField().
2015-07-16 20:11:43 +02:00
Mathieu Darse
78ab5b31dc Fix search when narrowed to private fields only 2015-07-16 19:52:25 +02:00
Mathieu Darse
1e31b68c5f Refactor Term (Thesaurus), Text and Raw queries to work with private fields
Also fix a bug in QueryHelper::applyBooleanClause()
2015-07-10 20:58:37 +02:00
Mathieu Darse
d778ab5126 Refactor query context
No more private collection map, uses new features from LimitedStructure.
From now on, Context tries to return Field objects instead of strings.

New context methods:
- getUnrestrictedFields()
- getPrivateFields()
- localizeField(Field) (signature changed)
- localizeFieldName(string)

QueryContext::localizeField() now takes a Field object, use localizeFieldName() if you want to pass a string.

Field::getIndexFieldName() renamed to Field::getIndexField().
Raw index fields are now obtained with Field::getIndexField(true).
2015-07-10 17:33:10 +02:00
Mathieu Darse
92e56105bd Generalize private fields query build 2015-07-03 18:58:35 +02:00
Mathieu Darse
e4aafaac10 Restrict search on visible private fields
Search on private fields is only supported on bare text search right now (TextNode).
This also fix and issue on databox::get_collection_unique_ids() returning the
value from the first call over and over.
2015-07-03 14:33:48 +02:00