Commit Graph

656 Commits

Author SHA1 Message Date
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
Mathieu Darse
d26330a17f Fix date validation, range query & equality operator 2015-08-24 11:26:46 +02:00
Benoît Burnichon
453cb0453d Merge pull request #1472 from jygaulier/PHRAS-668_NBR-FACETS
PHRAS-668
2015-08-20 11:24:10 +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
Jean-Yves Gaulier
01dd0ad88a #PHRAS-610 #time 1m
cs to force travis rebuild...
2015-08-18 18:45:00 +02:00
Jean-Yves Gaulier
ef7de07b1a #PHRAS-610 #time 10h 2015-08-18 16:50:55 +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
3ac83408fc #PHRAS-610 #time 2d
WIP
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
5bbd4bfe33 Fix values lookup on thesaurus hydrator 2015-07-24 18:13:18 +02:00
Benoît Burnichon
81cce5efa2 Merge pull request #1456 from mdarse/fix-regular-text-search
Fix query builds to only hit compatible fields
2015-07-24 17:05:50 +02:00
Mathieu Darse
3569d47467 Fix query builds to only hit compatible fields 2015-07-24 15:28:21 +02:00
Benoît Burnichon
3a8e147db5 Merge pull request #1455 from mdarse/fix-number-field-search
Remove unused QueryContext#getRawFields()
2015-07-24 12:49:52 +02:00
Benoît Burnichon
7e76236a06 Merge pull request #1453 from mdarse/invalid-field-query
Handle queries with invalid fields
2015-07-24 11:26:57 +02:00
Benoît Burnichon
b558cf9de3 Merge pull request #1452 from mdarse/fix-number-field-search
Fix number field search
2015-07-23 22:11:54 +02:00
Mathieu Darse
afbb0e3696 Handle queries with invalid fields
They lead to zero result instead of all results from elasticsearch.
2015-07-23 19:11:12 +02:00
Mathieu Darse
af129601e7 Remove unused QueryContext#getRawFields() 2015-07-23 19:03:34 +02:00
Mathieu Darse
a59c42980c Fix facets on non string fields & fix raw with "in" query 2015-07-23 18:41:10 +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
Jean-Yves Gaulier
82a8c97790 #PHRAS-606 #time 5m
fix: mime is forced into es
2015-07-21 18:23:21 +02:00
Jean-Yves Gaulier
00f8c8735d #PHRAS-606 #time 4h
fix default "binary" thumbnails for stories
nb : must re-populate
2015-07-21 16:54:36 +02:00
Benoît Burnichon
e0573fc4f6 Merge pull request #1423 from mdarse/private-fields-ast
Restrict search on visible private fields
2015-07-17 17:36:30 +02:00
Mathieu Darse
daea7f8c77 Raw queries do not localize fields anymore 2015-07-17 15:58:39 +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
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
7a330d2ef6 Fix highlight on private fields 2015-07-16 18:28:34 +02:00
Mathieu Darse
419c147982 Fix LimitedCollection::get() & add tests 2015-07-16 18:27:48 +02:00
Mathieu Darse
83d9cd4790 Fix getUnrestrictedFields() when called on non narrowed query context
Add tests and prevent AST to rely on field key by returning indexed arrays
instead of associative ones.
2015-07-16 15:44:16 +02:00
Jean-Yves Gaulier
d012978508 PHRAS-504 #time 8h
fix: prod / cr-lf in metadata is ok for aggregate  filter
cr,lf,crlf are normalized
- getting field values from recordadapter
- during es indexation (direct sql read in metadata...)
- before querying
2015-07-15 11:10:38 +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
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
Thibaud Fabre
ea6a4fdbf0 Extract repository and factory classes for collections 2015-07-09 12:32:06 +02:00
Mathieu Darse
83999b425c Fix private fields collections 2015-07-09 11:28:57 +02:00
Benoît Burnichon
8ee5279d58 Remove all uses of databox_field::get_instance 2015-07-08 11:08:07 +02:00
Mathieu Darse
aa0b40b679 Test TermNode 2015-07-03 20:01:29 +02:00
Mathieu Darse
6b88b7d17b Tests & private fields support on QuotedTextNode 2015-07-03 20:01:20 +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
393e4c62c1 Test thesaurus Concept 2015-07-03 16:57:33 +02:00
Mathieu Darse
570e4fea81 Test TextNode
Make buildConceptQueries() return early when no concepts are available (do not
call getFields() uselessly anymore).
2015-07-03 16:54:47 +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
1d0257554b Fix code style on latest query parser feature & add tests 2015-07-02 19:06:44 +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
ff67120388 Fixup some tests that fails with Elasticsearch. 2015-07-02 12:33:19 +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
Benoît Burnichon
6e651f3b07 Replace app['phraseanet.appbox']->get_databox using trait 2015-07-02 12:27:26 +02:00