Mapping configuration


(OlgaT) #1

Hi,

I would like to map two (or more ) properties to one common field.
Also I would like to map the same properties several fields.
For example:
class A {
String a;
String b;
String c;
}

I would like that

  • property"a" will be mapped to field "a" and field "commonField"
  • property"b" will be mapped to field "b" and field "commonField"
  • property"c" will be mapped to field "c"

Do I have this possibility in elastic search?
Thanks,
Olga


(Shay Banon) #2

You need to do that yourself by creating a common field. Another option is
the _all field which by default includes all fields, but you can exclude
some from it using the mapping.

This can be a feature in elasticsearch, for users to define "custom" _all
fields, that will include only specific fields. Shouldn't be too difficult
to implement...

On Tue, Jul 26, 2011 at 10:31 AM, OlgaT tubmano@gmail.com wrote:

Hi,

I would like to map two (or more ) properties to one common field.
Also I would like to map the same properties several fields.
For example:
class A {
String a;
String b;
String c;
}

I would like that

  • property"a" will be mapped to field "a" and field "commonField"
  • property"b" will be mapped to field "b" and field "commonField"
  • property"c" will be mapped to field "c"

Do I have this possibility in elastic search?
Thanks,
Olga


(OlgaT) #3

Hi Shay,

Are you going to implement this feature? If yes, then when.
We need it.

Thanks,
Olga

On Tue, Jul 26, 2011 at 3:03 PM, Shay Banon shay.banon@elasticsearch.comwrote:

You need to do that yourself by creating a common field. Another option is
the _all field which by default includes all fields, but you can exclude
some from it using the mapping.

This can be a feature in elasticsearch, for users to define "custom" _all
fields, that will include only specific fields. Shouldn't be too difficult
to implement...

On Tue, Jul 26, 2011 at 10:31 AM, OlgaT tubmano@gmail.com wrote:

Hi,

I would like to map two (or more ) properties to one common field.
Also I would like to map the same properties several fields.
For example:
class A {
String a;
String b;
String c;
}

I would like that

  • property"a" will be mapped to field "a" and field "commonField"
  • property"b" will be mapped to field "b" and field "commonField"
  • property"c" will be mapped to field "c"

Do I have this possibility in elastic search?
Thanks,
Olga


(Shay Banon) #4

Open an issue for it.

On Tue, Jul 26, 2011 at 5:13 PM, Olga Tubman tubmano@gmail.com wrote:

Hi Shay,

Are you going to implement this feature? If yes, then when.
We need it.

Thanks,
Olga

On Tue, Jul 26, 2011 at 3:03 PM, Shay Banon shay.banon@elasticsearch.comwrote:

You need to do that yourself by creating a common field. Another option is
the _all field which by default includes all fields, but you can exclude
some from it using the mapping.

This can be a feature in elasticsearch, for users to define "custom" _all
fields, that will include only specific fields. Shouldn't be too difficult
to implement...

On Tue, Jul 26, 2011 at 10:31 AM, OlgaT tubmano@gmail.com wrote:

Hi,

I would like to map two (or more ) properties to one common field.
Also I would like to map the same properties several fields.
For example:
class A {
String a;
String b;
String c;
}

I would like that

  • property"a" will be mapped to field "a" and field "commonField"
  • property"b" will be mapped to field "b" and field "commonField"
  • property"c" will be mapped to field "c"

Do I have this possibility in elastic search?
Thanks,
Olga


(Shay Banon) #5

It is possible to have a "combo" field that will use the specific analyzers
associated with the fields forming that "combo" field, but, the problem with
that is which analyzer will you use when you search on that field?

On Wed, Jul 27, 2011 at 12:05 PM, Olivier Favre olivier@yakaz.com wrote:

It is interesting to automatically create a (possibly) multi-valued common
field from multiple fields.
But how would you like to search against it in the case the original and
common fields have different analyzers?

If it works alike _all, the values would be re-analyzed using the common
field's settings and you may lack useful advanced analysis you've
configured.

I would personally like something else: Merging the analyzed terms (cached
TokenStreams) from the original fields. Thus, any advanced configuration
would not be lost, and searching could be performed with any correct
analyzer, maybe using a combination of those (see
https://github.com/elasticsearch/elasticsearch/issues/1128).

This (merging the tokens more than the values), would also be very useful
for us.
I'll open an issue for it.

--
Olivier Favre

www.yakaz.com

2011/7/26 Shay Banon shay.banon@elasticsearch.com

Open an issue for it.

On Tue, Jul 26, 2011 at 5:13 PM, Olga Tubman tubmano@gmail.com wrote:

Hi Shay,

Are you going to implement this feature? If yes, then when.
We need it.

Thanks,
Olga

On Tue, Jul 26, 2011 at 3:03 PM, Shay Banon <
shay.banon@elasticsearch.com> wrote:

You need to do that yourself by creating a common field. Another option
is the _all field which by default includes all fields, but you can exclude
some from it using the mapping.

This can be a feature in elasticsearch, for users to define "custom"
_all fields, that will include only specific fields. Shouldn't be too
difficult to implement...

On Tue, Jul 26, 2011 at 10:31 AM, OlgaT tubmano@gmail.com wrote:

Hi,

I would like to map two (or more ) properties to one common field.
Also I would like to map the same properties several fields.
For example:
class A {
String a;
String b;
String c;
}

I would like that

  • property"a" will be mapped to field "a" and field "commonField"
  • property"b" will be mapped to field "b" and field "commonField"
  • property"c" will be mapped to field "c"

Do I have this possibility in elastic search?
Thanks,
Olga


(Shay Banon) #6

Yea, but that creates a complicated integration point, as queries need to
know about the analyzers and possibly create OR clauses for example, or
maybe dis max, or something else...

What I meant by my comments is that this feature is quite complex in terms
of trying and make it usable.

On Wed, Jul 27, 2011 at 12:27 PM, Olivier Favre olivier@yakaz.com wrote:

Either original analyzer would yield results.
But you can also use the same combo analyzer (well, another especially
created in the configuration to match the same analyzers from the original
fields), using an OR operator, or a text_phrase query (mapping to
MultiPhraseQuery).

I've been successfully using the combo analyzer using "simple" and
"english" during indexing, and another using "simple" and, say, "french"
during search.

Olivier Favre

www.yakaz.com

2011/7/27 Shay Banon kimchy@gmail.com

It is possible to have a "combo" field that will use the specific
analyzers associated with the fields forming that "combo" field, but, the
problem with that is which analyzer will you use when you search on that
field?

On Wed, Jul 27, 2011 at 12:05 PM, Olivier Favre olivier@yakaz.comwrote:

It is interesting to automatically create a (possibly) multi-valued
common field from multiple fields.
But how would you like to search against it in the case the original and
common fields have different analyzers?

If it works alike _all, the values would be re-analyzed using the common
field's settings and you may lack useful advanced analysis you've
configured.

I would personally like something else: Merging the analyzed terms
(cached TokenStreams) from the original fields. Thus, any advanced
configuration would not be lost, and searching could be performed with any
correct analyzer, maybe using a combination of those (see
https://github.com/elasticsearch/elasticsearch/issues/1128).

This (merging the tokens more than the values), would also be very useful
for us.
I'll open an issue for it.

--
Olivier Favre

www.yakaz.com

2011/7/26 Shay Banon shay.banon@elasticsearch.com

Open an issue for it.

On Tue, Jul 26, 2011 at 5:13 PM, Olga Tubman tubmano@gmail.com wrote:

Hi Shay,

Are you going to implement this feature? If yes, then when.
We need it.

Thanks,
Olga

On Tue, Jul 26, 2011 at 3:03 PM, Shay Banon <
shay.banon@elasticsearch.com> wrote:

You need to do that yourself by creating a common field. Another
option is the _all field which by default includes all fields, but you can
exclude some from it using the mapping.

This can be a feature in elasticsearch, for users to define "custom"
_all fields, that will include only specific fields. Shouldn't be too
difficult to implement...

On Tue, Jul 26, 2011 at 10:31 AM, OlgaT tubmano@gmail.com wrote:

Hi,

I would like to map two (or more ) properties to one common field.
Also I would like to map the same properties several fields.
For example:
class A {
String a;
String b;
String c;
}

I would like that

  • property"a" will be mapped to field "a" and field "commonField"
  • property"b" will be mapped to field "b" and field "commonField"
  • property"c" will be mapped to field "c"

Do I have this possibility in elastic search?
Thanks,
Olga


(Shay Banon) #7

On Wed, Jul 27, 2011 at 12:46 PM, Olivier Favre olivier@yakaz.com wrote:

What is the cost of searching against multiple fields' indexes, compared to
searching to one "merged" field index?

Depends on the query you generate, but it will be slower. Besides, you can
do it now by executing queries against different fields using the same
search request, the search will use the relevant analyzer defined on that
field.

Even with no integration for search time, providing a combined field will
surely be beneficial to some people.

Not really, you need to think about the search aspect as well. Combined
fields, with different analyzers, are not a common requirement (for me),
especially since you can solve it using the above mentioned way.

--
Olivier Favre

www.yakaz.com

2011/7/27 Shay Banon kimchy@gmail.com

Yea, but that creates a complicated integration point, as queries need to
know about the analyzers and possibly create OR clauses for example, or
maybe dis max, or something else...

What I meant by my comments is that this feature is quite complex in terms
of trying and make it usable.

On Wed, Jul 27, 2011 at 12:27 PM, Olivier Favre olivier@yakaz.comwrote:

Either original analyzer would yield results.
But you can also use the same combo analyzer (well, another especially
created in the configuration to match the same analyzers from the original
fields), using an OR operator, or a text_phrase query (mapping to
MultiPhraseQuery).

I've been successfully using the combo analyzer using "simple" and
"english" during indexing, and another using "simple" and, say, "french"
during search.

Olivier Favre

www.yakaz.com

2011/7/27 Shay Banon kimchy@gmail.com

It is possible to have a "combo" field that will use the specific
analyzers associated with the fields forming that "combo" field, but, the
problem with that is which analyzer will you use when you search on that
field?

On Wed, Jul 27, 2011 at 12:05 PM, Olivier Favre olivier@yakaz.comwrote:

It is interesting to automatically create a (possibly) multi-valued
common field from multiple fields.
But how would you like to search against it in the case the original
and common fields have different analyzers?

If it works alike _all, the values would be re-analyzed using the
common field's settings and you may lack useful advanced analysis you've
configured.

I would personally like something else: Merging the analyzed terms
(cached TokenStreams) from the original fields. Thus, any advanced
configuration would not be lost, and searching could be performed with any
correct analyzer, maybe using a combination of those (see
https://github.com/elasticsearch/elasticsearch/issues/1128).

This (merging the tokens more than the values), would also be very
useful for us.
I'll open an issue for it.

--
Olivier Favre

www.yakaz.com

2011/7/26 Shay Banon shay.banon@elasticsearch.com

Open an issue for it.

On Tue, Jul 26, 2011 at 5:13 PM, Olga Tubman tubmano@gmail.comwrote:

Hi Shay,

Are you going to implement this feature? If yes, then when.
We need it.

Thanks,
Olga

On Tue, Jul 26, 2011 at 3:03 PM, Shay Banon <
shay.banon@elasticsearch.com> wrote:

You need to do that yourself by creating a common field. Another
option is the _all field which by default includes all fields, but you can
exclude some from it using the mapping.

This can be a feature in elasticsearch, for users to define "custom"
_all fields, that will include only specific fields. Shouldn't be too
difficult to implement...

On Tue, Jul 26, 2011 at 10:31 AM, OlgaT tubmano@gmail.com wrote:

Hi,

I would like to map two (or more ) properties to one common field.
Also I would like to map the same properties several fields.
For example:
class A {
String a;
String b;
String c;
}

I would like that

  • property"a" will be mapped to field "a" and field
    "commonField"
  • property"b" will be mapped to field "b" and field
    "commonField"
  • property"c" will be mapped to field "c"

Do I have this possibility in elastic search?
Thanks,
Olga


(system) #8