Include _type in _all


(Gábor Suhai) #1

Hi,

Is it possible to include the _type field in the _all field?
I tried this mapping:

{
"mytype": {
"_type": {"include_in_all": "true"},
"properties": {
"name": {
"store": "true",
"include_in_all": "true",
"type": "string"
}
}
}
}

but only the content of the "name" field appears in the _all field.

Thanks
Gábor


(Shay Banon) #2

No, type is not included in _all, and you can't control it… . Why do you need it?

On Wednesday, February 15, 2012 at 5:39 PM, Gábor Suhai wrote:

Hi,

Is it possible to include the _type field in the _all field?
I tried this mapping:

{
"mytype": {
"_type": {"include_in_all": "true"},
"properties": {
"name": {
"store": "true",
"include_in_all": "true",
"type": "string"
}

       }
 }

}

but only the content of the "name" field appears in the _all field.

Thanks
Gábor


(Gábor Suhai) #3

I have multiple types in my index and my plan was, for each type, to
include some properties of the type and the type itself into the _all
field, so from a single search field the user can search for the properties
and the type too.
Let's say there's a bank called ABC. If I'm looking for a branch, I search
for "abc branch", but if I'm only interested in ATMs, I search for "abc
atm", and if any ATM will do, I search for "atm". Branch and ATM is a type,
and ABC is the value of the name property of these types.


(Shay Banon) #4

One way is to just let the user filter the type, something like: _type:abc (or have your own filtering). Otherwise, that filtering is not really effective usability wise.

On Thursday, February 16, 2012 at 8:23 AM, Gábor Suhai wrote:

I have multiple types in my index and my plan was, for each type, to include some properties of the type and the type itself into the _all field, so from a single search field the user can search for the properties and the type too.
Let's say there's a bank called ABC. If I'm looking for a branch, I search for "abc branch", but if I'm only interested in ATMs, I search for "abc atm", and if any ATM will do, I search for "atm". Branch and ATM is a type, and ABC is the value of the name property of these types.


(system) #5