fix: the default sort field/direction (defined as relevance/desc for es) is applied at startup & reset button.
add : default direction
todo in 4.0.1 : allow to change in config/admin ?
fix: the field(s) selected in adv-search are applied to whole query.
nb : may return error message if query + filter is nonsense, ex:
Query="foo IN Title" + Filter="Keywords"
- 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)
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).
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.
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]
- Date and number types sanitization
- Remove `RecordIndexer` dependency on `ElasticSearchEngine`
- Move some sanitization from `RecordIndexer` to `RecordHelper`
- Index the full content of a record in a (private_)content_all field
- Handle all fields wide search as a special-case (drastically simplify queries)
- QueryContext doesn't take all allowed fields anymore, but whether private
fields are allowed or not. Since private fields are namespaced, field level
restriction is not needed anymore.