- Single property for facet settings in Field, we can’t have a limit
with disabled faceting.
- Fixes bug when fields having incompatible limit but are still merged together.
- Use constants for special limit values (i.e. no limit)
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
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).
- Field class is now immutable, mergeWith() returns a new instance
- Thesaurus roots are recursively merged
- In case of field merge, Structure class do not index the previous field
- Added failing test case for previous bugs
- Added merge tests on Field class
- Added tests for all indexed stuff inside Structure class
Here is the new model:
+-----------------------------+
| Structure |
+-----------------------------+
| +createFromDataboxes() |
| getAllFields() |
| getUnrestrictedFields() |
| getPrivateFields() |
| getFacetsFields() |
| getThesaurusEnabledFields() |
| getDateFields() |
|- - - - - - - - - - - - - - -|
| add() |
| get() |
| typeOf() |
| isPrivate() |
+-------+-+-+-----------------+
| | | +---------------------+
| | +--------> | Field |
| | +---------------------+
| | | getName() |
| | | getType() |
| | | isXXX() |
| | | getThesaurusRoots() |
| | +---------------------+
| |
| | +-------+
| +----------> | Field |
| +-------+
|
| +-------+
+------------> | Field |
+-------+
It was driven by the following use cases:
- Get list of facets (only searchable fields)
- Get list of fields with concept inference
- Get list of all fields
- Splitted in private / public fields (to define mapping)
- Get all date fields
- Get field type
- To apply sanitization rules
- To define mapping
- Check if concept inference enabled
- Check if the field is searchable
- Check if the field is a facet
- Check if the field is private
- Dereference field from label (still to be done)
(The last two UCs are new)
Also removed old code from legacy search engines.
[#PHRAS-500]