Commit Graph

116 Commits

Author SHA1 Message Date
Jean-Yves Gaulier
e8f61a443b PHRAS-676 #time 3h
new : returns facet on "type" (image, video, ...)
new : query on pseudo-field "type", ex:  "type:image"
2015-09-04 14:34:25 +02:00
Mathieu Darse
a51fe87f11 Highlight using raw field data too 2015-08-31 19:17:46 +02:00
Mathieu Darse
f0dad09f51 Fix « field to highlight » list fetching 2015-08-31 19:12:25 +02:00
Mathieu Darse
f4db1081fd Optimize highlight speed 2015-08-27 17:01:20 +02:00
Benoît Burnichon
3a36410dd6 Merge pull request #1479 from jygaulier/PHRAS-669_default-sort
PHRAS-669
2015-08-27 12:11:40 +02:00
Benoît Burnichon
065084818b Merge pull request #1474 from mdarse/facet-values-size-wording
Simpler facet handling in ES structure
2015-08-26 18:06:09 +02:00
Jean-Yves Gaulier
09fde387d7 #PHRAS-669 #time 1d
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 ?
2015-08-26 17:15:43 +02:00
Jean-Yves Gaulier
2b1774d994 #PHRAS-230 #time 2h
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"
2015-08-25 16:29:47 +02:00
Mathieu Darse
7e8a4a53a3 Simpler facet handling in ES structure
- 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)
2015-08-24 16:07:53 +02:00
Jean-Yves Gaulier
72bb1877a7 #PHRAS-668 #time 1d
- fix: facets number (admin/field) is now used by prod.
- add: query/es : removed useless & pack clauses on status masks -> shortest (fastest ?) query
2015-08-20 11:08:55 +02:00
Mathieu Darse
a813ef51e7 Restrict facets to show only visible content on private fields 2015-07-17 14:30:01 +02:00
Mathieu Darse
7a330d2ef6 Fix highlight on private fields 2015-07-16 18:28:34 +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
929705f13e Structure -> GlobalStructure + LimitedStructure
Rename Structure to GlobalStructure.
Add new LimitedStructure to wrap another Structure and transparently restrict
access on private fields.
2015-07-10 12:30:13 +02:00
Mathieu Darse
83999b425c Fix private fields collections 2015-07-09 11:28:57 +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
Benoît Burnichon
6e52421437 Merge pull request #1390 from mdarse/private-fields-collection-map
Fields « used by » collection map
2015-07-02 12:55:45 +02:00
Benoît Burnichon
d645b92afa Add AclAware Trait 2015-07-02 12:33:18 +02:00
Benoît Burnichon
4880f2bf5a Add getAuthenticator usage
Replace $app['authentication']->getUser() by $app->getAuthenticatedUser()
replace twig app['authentication'].getUser() with corresponding method
2015-07-02 12:33:18 +02:00
Mathieu Darse
0f7deea610 Fix wrong query context instanciation 2015-07-02 12:25:36 +02:00
Benoît Burnichon
7711d89ad2 Remove privateCollectionMap as not used and make test fail. 2015-06-29 20:28:16 +02:00
Mathieu Darse
6da62a55b3 Fix search options serialization & query context creation 2015-06-29 19:15:52 +02:00
Mathieu Darse
4157d14d1b Get collections by private fields & filter collections by user rights 2015-06-29 19:15:52 +02:00
Mathieu Darse
8e45b3872f Fix context create 2015-06-29 19:15:52 +02:00
Benoît Burnichon
acb8ed86c8 Retrieve Collections indexed by field name 2015-06-29 19:15:51 +02:00
Mathieu Darse
9172da904b Braindump of collection-fields map 2015-06-29 19:13:56 +02:00
Benoît Burnichon
041f017fd7 Merge pull request #1395 from jygaulier/PHRAS-442_FACETS-IN-API
PHRAS-442
2015-06-29 17:55:56 +02:00
Benoît Burnichon
28fee99fc4 Add Form for ElasticSearch Configuration.
Also changed type from array to Options object.
2015-06-29 17:10:32 +02:00
Jean-Yves Gaulier
2ee19c17f5 PHRAS-442 #time 1h
less coupling (mdarse)
2015-06-22 19:07:56 +02:00
Jean-Yves Gaulier
1d0dcaa240 PHRAS-442 #time 5h
facets returned in API
"suggestions" returned in API (as flat facets)
2015-06-22 18:20:22 +02:00
Jean-Yves Gaulier
7ef8e2c037 wip 2015-06-22 17:41:32 +02:00
Mathieu Darse
804b5a64a3 Fix type search regression 2015-06-19 21:46:28 +02:00
Mathieu Darse
ea8eb4dc07 Fix another IN search regression from 40e2df6c3f
Move getIndexFieldName() from `RecordHelper` to `Field`.
Also remove an unused injected dependency
2015-06-15 19:18:06 +02:00
Mathieu Darse
40e2df6c3f Search in private fields using new structure features 2015-06-03 19:45:49 +02:00
Mathieu Darse
b14c845811 Remove remaining calls to getFieldsStructure() 2015-06-03 19:45:48 +02:00
Mathieu Darse
421684757a Refactor merged field structure
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]
2015-06-03 19:45:48 +02:00
Benoît Burnichon
649f0fe510 Refactor can see business fields. 2015-05-29 17:53:45 +02:00
Nicolas Le Goff
2d5a36f5a2 Add highlights query 2015-05-05 11:09:28 +02:00
Mathieu Darse
4785fbc8ed Fix indexing issue with date fields
- Date and number types sanitization
- Remove `RecordIndexer` dependency on `ElasticSearchEngine`
- Move some sanitization from `RecordIndexer` to `RecordHelper`
2015-04-15 18:28:12 +02:00
Benoît Burnichon
6d4fcbbe9a Refactor SearchEngineController 2015-04-13 17:44:44 +02:00
Benoît Burnichon
7af53aaef4 Merge pull request #1328 from mdarse/qp-ina-oreo
Parsing of INA/OREO queries
2015-03-30 17:53:15 +02:00
Mathieu Darse
171eec6dcb Proper date fields lazy-loading 2015-03-30 17:41:12 +02:00
Mathieu Darse
99e62f7530 QueryParser -> QueryCompiler 2015-03-30 16:17:40 +02:00
Mathieu Darse
771aa5b765 Working cross-fields queries with multiple words (without operators)
- 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.
2015-03-24 17:52:30 +01:00
Benoît Burnichon
5d651fc782 Merge pull request #1308 from mdarse/facets-smart-escaping
Smart facet value escaping (the return)
2015-03-19 16:46:44 +01:00
Mathieu Darse
679106d226 Fix typos and check-in Escaper 2015-03-19 16:41:53 +01:00
Benoît Burnichon
8508c81e2d Merge pull request #1305 from mdarse/facets-smart-escaping
Smart facet value escaping
2015-03-19 15:35:57 +01:00
Mathieu Darse
59d2c86a2a Clean ElasticSearchEngine 2015-03-19 13:44:24 +01:00
Mathieu Darse
b1a03ae566 Smart facet value escaping 2015-03-19 13:42:04 +01:00
Mathieu Darse
d766dccfff Remove useless dynamic search dispatch 2015-03-17 19:45:24 +01:00