mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 09:53:15 +00:00
PHRAS-2497 #comment port to 4.1 Search issue when query mix data from Public and Private field
#time 2h
This commit is contained in:
@@ -47,7 +47,9 @@ class QuotedTextNodeTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
public function testQueryBuildWithPrivateFields()
|
||||
{
|
||||
$public_field = new Field('foo', FieldMapping::TYPE_STRING, ['private' => false]);
|
||||
$public_field = new Field('foo', FieldMapping::TYPE_STRING, [
|
||||
'private' => false
|
||||
]);
|
||||
$private_field = new Field('bar', FieldMapping::TYPE_STRING, [
|
||||
'private' => true,
|
||||
'used_by_collections' => [1, 2, 3]
|
||||
@@ -75,7 +77,10 @@ class QuotedTextNodeTest extends \PHPUnit_Framework_TestCase
|
||||
"should": [{
|
||||
"multi_match": {
|
||||
"type": "phrase",
|
||||
"fields": ["foo.fr", "foo.en"],
|
||||
"fields": [
|
||||
"foo.fr",
|
||||
"foo.en"
|
||||
],
|
||||
"query": "baz",
|
||||
"lenient": true
|
||||
}
|
||||
@@ -89,7 +94,12 @@ class QuotedTextNodeTest extends \PHPUnit_Framework_TestCase
|
||||
"query": {
|
||||
"multi_match": {
|
||||
"type": "phrase",
|
||||
"fields": ["private_caption.bar.fr", "private_caption.bar.en"],
|
||||
"fields": [
|
||||
"private_caption.bar.fr",
|
||||
"private_caption.bar.en",
|
||||
"foo.fr",
|
||||
"foo.en"
|
||||
],
|
||||
"query": "baz",
|
||||
"lenient": true
|
||||
}
|
||||
|
@@ -126,12 +126,18 @@ class TermNodeTest extends \PHPUnit_Framework_TestCase
|
||||
"bool": {
|
||||
"should": [{
|
||||
"multi_match": {
|
||||
"fields": ["concept_path.bar"],
|
||||
"fields": [
|
||||
"concept_path.bar",
|
||||
"concept_path.foo"
|
||||
],
|
||||
"query": "/baz"
|
||||
}
|
||||
}, {
|
||||
"multi_match": {
|
||||
"fields": ["concept_path.bar"],
|
||||
"fields": [
|
||||
"concept_path.bar",
|
||||
"concept_path.foo"
|
||||
],
|
||||
"query": "/qux"
|
||||
}
|
||||
}]
|
||||
|
@@ -109,7 +109,12 @@ class TextNodeTest extends \PHPUnit_Framework_TestCase
|
||||
},
|
||||
"query": {
|
||||
"multi_match": {
|
||||
"fields": ["private_caption.bar.fr", "private_caption.bar.en"],
|
||||
"fields": [
|
||||
"private_caption.bar.fr",
|
||||
"private_caption.bar.en",
|
||||
"foo.fr",
|
||||
"foo.en"
|
||||
],
|
||||
"query": "baz",
|
||||
"type": "cross_fields",
|
||||
"operator": "and",
|
||||
@@ -216,7 +221,12 @@ class TextNodeTest extends \PHPUnit_Framework_TestCase
|
||||
"bool": {
|
||||
"should": [{
|
||||
"multi_match": {
|
||||
"fields": ["private_caption.bar.fr", "private_caption.bar.en"],
|
||||
"fields": [
|
||||
"private_caption.bar.fr",
|
||||
"private_caption.bar.en",
|
||||
"foo.fr",
|
||||
"foo.en"
|
||||
],
|
||||
"query": "baz",
|
||||
"type": "cross_fields",
|
||||
"operator": "and",
|
||||
@@ -224,7 +234,10 @@ class TextNodeTest extends \PHPUnit_Framework_TestCase
|
||||
}
|
||||
}, {
|
||||
"multi_match": {
|
||||
"fields": ["concept_path.bar"],
|
||||
"fields": [
|
||||
"concept_path.bar",
|
||||
"concept_path.foo"
|
||||
],
|
||||
"query": "/qux"
|
||||
}
|
||||
}]
|
||||
|
Reference in New Issue
Block a user