Commit Graph

31 Commits

Author SHA1 Message Date
Mathieu Darse
8e5d09bd76 Test value compatibility before creating ES query 2015-11-10 16:40:10 +01:00
Benoît Burnichon
a41df40d49 Merge pull request #1497 from mdarse/fix-691-cross-field-query
PHRAS-691
2015-09-08 10:52:07 +02:00
Mathieu Darse
03cddfadc9 Fix freetext after IN query
"Foo IN Bar AND Baz" causes AST construction to fail.
2015-09-07 17:35:03 +02:00
Mathieu Darse
a3efd78055 Fix cross field queries (see PHRAS-691) 2015-09-07 16:05:10 +02:00
Mathieu Darse
ed0affa921 buildConceptQueriesForFields() replaces buildConceptQueries() 2015-08-27 17:35:34 +02:00
Mathieu Darse
064c5e01a6 Wrap text and concept queries with a single filtered query 2015-08-26 19:29:26 +02: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
e058814638 Test TextNode with private fields and concepts on private fields 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
Jean-Yves Gaulier
41758fe341 #PHRAS-622 #time 5m
cs to fix errors in phpstorm
2015-08-17 15:18:33 +02:00
Jean-Yves Gaulier
d984938614 #PHRAS-622 #time 3h
add 'lenient' to prevent es errors when parsing invalid dates
cs
2015-07-29 16:39:19 +02:00
Mathieu Darse
3569d47467 Fix query builds to only hit compatible fields 2015-07-24 15:28:21 +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
78ab5b31dc Fix search when narrowed to private fields only 2015-07-16 19:52:25 +02:00
Mathieu Darse
92e56105bd Generalize private fields query build 2015-07-03 18:58:35 +02:00
Mathieu Darse
386251b91c Remove duplication & fix test class name 2015-07-03 17:40:56 +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
Mathieu Darse
38465a591f Strict facet matching
Clicking on a facet value on the left pane now return the expected result count.

This commit implement a new "raw" matcher. It can be used like
`r"some raw value"`. It operate on the the `.raw` multi-field and skips all
analysis.
Escaping `"` is supported by prepending a backslash `\"`. You can also escape
the escaping character `\` by doubling it (`\\`).

Adds a new `ContextAbleInterface` to differenciate matcher supporting an
optional context from those who can't.

Fixes an issue with `QueryContext::narrowToFields()` ignoring passed fields.
2015-04-09 20:32:13 +02:00
Mathieu Darse
a9a1d44447 Fix term/text/context nodes merging 2015-03-30 16:30:12 +02:00
Mathieu Darse
99e61d6368 Use conjonction for coalesced words in text nodes 2015-03-12 11:41:19 +01:00
Mathieu Darse
fe7e63b3d7 QuotedTextNode don't inherit anymore from TextNode
- Quoted text do not hit the thesaurus anymore
- getTextNodes() was misleading, renamed to getTermNodes()
2015-02-25 12:22:52 +01:00
Mathieu Darse
8c1848afae Expression context support in thesaurus lookup 2015-02-25 12:22:13 +01:00
Mathieu Darse
e5bda79cf8 Bracket syntax does a thesaurus search only 2015-02-25 12:19:00 +01:00
Mathieu Darse
712850ac67 Update grammar and AST for bracket notation 2015-02-25 12:19:00 +01:00
Mathieu Darse
9560628037 Prune narrow concepts while building query 2015-01-20 18:28:22 +01:00
Mathieu Darse
dc2c9f8c7f 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
2015-01-20 15:05:15 +01:00
Mathieu Darse
d0b3995a33 Text nodes extraction from queries 2015-01-20 14:44:00 +01:00
Mathieu Darse
532f240ffd Parse tree visitor to build ES query 2014-11-06 19:11:06 +01:00
Damien Alexandre
4a09e9d52c The thesaurus is only asked on fulltext search only mode 2014-09-23 19:20:14 +02:00
Damien Alexandre
4de826771b Switch all query parts to multi-fields match (will be used later) 2014-09-22 17:55:33 +02:00
Mathieu Darse
12a757978f Update PoC parser with AST 2014-08-25 10:25:38 +02:00