In Solr, How to request a single field for a single set of values ​​in a multi-valued field

Basically, I want Solr to search for each record of a multi-valued field for my search parameter. read in my example:

I use Solr to index my data. I have application data in parallel arrays (in the form of multi-valued fields) that correspond to this product. See the following example where make, model and year are multi-valued fields:

<-solr record start->
sku: 1234
make: acura, acura, acura
model: integra, rsx, rsx
year: 1997, 2004, 2000
engine: 3.4, 4.5, 4.5
<-solr record end->

(& fq =), . , - 2000 Acura Integra, , make, model year , 2000 Acura Integra . Solr make, ( ) , parallelism. :


fq=make:"acura"&fq=model:"integra"&fq=year:2000 (I would normally escape URL characters when I POST to Solr, this is just an example)

, , , make, model, year (, ) . , . :

<-solr record start->
sku: 1234
make: acura, acura, acura
model: integra, rsx, rsx
year: 1997, 2004, 2000
engine: 3.4, 4.5, 4.5
summary: "acura" "integra" "1997" "3.4", "acura" "rsx" "2004" "4.5", "acura" "rsx" "2000", "4.5"
<-solr record end->

:

summary:(""acura" AND "integra" AND "2000")

, , , acura integra 2000. . . . - . .

, Solr . ? , ?

+3
3

, parallelism , , . AND, , , ( AND'ed , ), , , , ~.

:

, : "Honda" "Accord" "2004" "3.5L"

, : summary_field:("\"Honda\" \"2004\"")

. , , , , (, ) , , . Honda 2004 . Accord .

, ~ n, n - , . , :

summary_field:("\"Honda\" \"2004\""~1)

, Honda 2004 . , . , , , , . , 20 , parallelism, ~ 18, , .

+3

, . . " ", , . , :

sku: 1234
make: acura
model: integra
years: 1997
engines: 3.4, 4.5

sku: 1235
make: acura
model: rsx
years: 2000, 2004
engines: 4.5

summary copyField make + model + years + engines

+3

Can't you just execute the query as follows?

make:acura AND model:integra AND year:2000

those. No quotes around the make and model.

0
source

Source: https://habr.com/ru/post/1732323/


All Articles