Wrong ID in explain() method.

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Wrong ID in explain() method.

Vadim Gindin
Hi all.

I've written a simple plugin, that implements custom scoring logic and
extending `Explanation`. I have some real index data that looks like this:

    "_source": {
          "price": 10000,
          "params_model": "Дверь задняя правая Honda CR-V",
          "categories": [
            {
              "id": 3,
              "shop_category_id": "3",
              "name": "Кузов наружные элементы",
              "level": 1
            },
            {
              "id": 342,
              "shop_category_id": "62",
              "name": "Дверь задняя правая",
              "level": 2
            }
          ],
          "params_vendor": "Honda",
        }

My plugin remembers the document id (that was matched in scorer) to a
collection. When explain(id) is called it checks specified id in this
collection and outputs "matched"/"not matched".

The questions.
0. This document is founded by the plugin, but explain(id) method takes the
wrong ID. Why? It happens in the real installation, but in the test case -
it works fine.
1. ID=342 and others come to explain(id) method. Note, it is not a document
id - it is ID of the nested object (category). Why does it happen?
2. I have a test case, based on ESIntegTestCase. It works fine with this
document. But this document is not founded in the real index.

Regards,
Vadim Gindin
Reply | Threaded
Open this post in threaded view
|

Re: Wrong ID in explain() method.

Vadim Gindin
If I check

GET myindex/mytype/342

Nothing is found.

I suppose there is a name conflict and Lucene erroneously finds "id" of
a nested object (category from a list) and erroneously assumes that it is
an ID of a whole document.

Is that possible? Is "id" string is reserved word for Lucene?

Regards,
Vadim Gindin

On Wed, Dec 27, 2017 at 12:43 PM, Vadim Gindin <[hidden email]> wrote:

> Hi all.
>
> I've written a simple plugin, that implements custom scoring logic and
> extending `Explanation`. I have some real index data that looks like this:
>
>     "_source": {
>           "price": 10000,
>           "params_model": "Дверь задняя правая Honda CR-V",
>           "categories": [
>             {
>               "id": 3,
>               "shop_category_id": "3",
>               "name": "Кузов наружные элементы",
>               "level": 1
>             },
>             {
>               "id": 342,
>               "shop_category_id": "62",
>               "name": "Дверь задняя правая",
>               "level": 2
>             }
>           ],
>           "params_vendor": "Honda",
>         }
>
> My plugin remembers the document id (that was matched in scorer) to a
> collection. When explain(id) is called it checks specified id in this
> collection and outputs "matched"/"not matched".
>
> The questions.
> 0. This document is founded by the plugin, but explain(id) method takes
> the wrong ID. Why? It happens in the real installation, but in the test
> case - it works fine.
> 1. ID=342 and others come to explain(id) method. Note, it is not a
> document id - it is ID of the nested object (category). Why does it happen?
> 2. I have a test case, based on ESIntegTestCase. It works fine with this
> document. But this document is not founded in the real index.
>
> Regards,
> Vadim Gindin
>
Reply | Threaded
Open this post in threaded view
|

Re: Wrong ID in explain() method.

Mikhail Khludnev-2
Responded on the elastic forum. Have you seen it?


On Fri, Dec 29, 2017 at 9:25 AM, Vadim Gindin <[hidden email]> wrote:

> If I check
>
> GET myindex/mytype/342
>
> Nothing is found.
>
> I suppose there is a name conflict and Lucene erroneously finds "id" of
> a nested object (category from a list) and erroneously assumes that it is
> an ID of a whole document.
>
> Is that possible? Is "id" string is reserved word for Lucene?
>
> Regards,
> Vadim Gindin
>
> On Wed, Dec 27, 2017 at 12:43 PM, Vadim Gindin <[hidden email]>
> wrote:
>
> > Hi all.
> >
> > I've written a simple plugin, that implements custom scoring logic and
> > extending `Explanation`. I have some real index data that looks like
> this:
> >
> >     "_source": {
> >           "price": 10000,
> >           "params_model": "Дверь задняя правая Honda CR-V",
> >           "categories": [
> >             {
> >               "id": 3,
> >               "shop_category_id": "3",
> >               "name": "Кузов наружные элементы",
> >               "level": 1
> >             },
> >             {
> >               "id": 342,
> >               "shop_category_id": "62",
> >               "name": "Дверь задняя правая",
> >               "level": 2
> >             }
> >           ],
> >           "params_vendor": "Honda",
> >         }
> >
> > My plugin remembers the document id (that was matched in scorer) to a
> > collection. When explain(id) is called it checks specified id in this
> > collection and outputs "matched"/"not matched".
> >
> > The questions.
> > 0. This document is founded by the plugin, but explain(id) method takes
> > the wrong ID. Why? It happens in the real installation, but in the test
> > case - it works fine.
> > 1. ID=342 and others come to explain(id) method. Note, it is not a
> > document id - it is ID of the nested object (category). Why does it
> happen?
> > 2. I have a test case, based on ESIntegTestCase. It works fine with this
> > document. But this document is not founded in the real index.
> >
> > Regards,
> > Vadim Gindin
> >
>



--
Sincerely yours
Mikhail Khludnev
Reply | Threaded
Open this post in threaded view
|

Re: Wrong ID in explain() method.

Vadim Gindin
Yes, thanks a lot for your help.

Do you mean that id of category must not be transferred to explain? If yes
why it is happen?

Regards
Vadim Gindin

29 дек. 2017 г. 14:22 пользователь "Mikhail Khludnev" <[hidden email]>
написал:

> Responded on the elastic forum. Have you seen it?
>
>
> On Fri, Dec 29, 2017 at 9:25 AM, Vadim Gindin <[hidden email]>
> wrote:
>
> > If I check
> >
> > GET myindex/mytype/342
> >
> > Nothing is found.
> >
> > I suppose there is a name conflict and Lucene erroneously finds "id" of
> > a nested object (category from a list) and erroneously assumes that it is
> > an ID of a whole document.
> >
> > Is that possible? Is "id" string is reserved word for Lucene?
> >
> > Regards,
> > Vadim Gindin
> >
> > On Wed, Dec 27, 2017 at 12:43 PM, Vadim Gindin <[hidden email]>
> > wrote:
> >
> > > Hi all.
> > >
> > > I've written a simple plugin, that implements custom scoring logic and
> > > extending `Explanation`. I have some real index data that looks like
> > this:
> > >
> > >     "_source": {
> > >           "price": 10000,
> > >           "params_model": "Дверь задняя правая Honda CR-V",
> > >           "categories": [
> > >             {
> > >               "id": 3,
> > >               "shop_category_id": "3",
> > >               "name": "Кузов наружные элементы",
> > >               "level": 1
> > >             },
> > >             {
> > >               "id": 342,
> > >               "shop_category_id": "62",
> > >               "name": "Дверь задняя правая",
> > >               "level": 2
> > >             }
> > >           ],
> > >           "params_vendor": "Honda",
> > >         }
> > >
> > > My plugin remembers the document id (that was matched in scorer) to a
> > > collection. When explain(id) is called it checks specified id in this
> > > collection and outputs "matched"/"not matched".
> > >
> > > The questions.
> > > 0. This document is founded by the plugin, but explain(id) method takes
> > > the wrong ID. Why? It happens in the real installation, but in the test
> > > case - it works fine.
> > > 1. ID=342 and others come to explain(id) method. Note, it is not a
> > > document id - it is ID of the nested object (category). Why does it
> > happen?
> > > 2. I have a test case, based on ESIntegTestCase. It works fine with
> this
> > > document. But this document is not founded in the real index.
> > >
> > > Regards,
> > > Vadim Gindin
> > >
> >
>
>
>
> --
> Sincerely yours
> Mikhail Khludnev
>