Sorting failing in latest master

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

Sorting failing in latest master

Samuel Doyle
I am now seeing failures in my search when sorting. I have not made any changes to my code or data which had worked previously.

Query Failed [Failed to execute main query]]; nested: IOException[Can't sort on string types with more than one value per doc, or more than one token per field]; ]

is this something new?

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Sorting failing in latest master

kimchy
Administrator
Are you sorting on an analyzed field or a field that has several values within a document?

-shay.banon

On Thu, Jul 15, 2010 at 2:18 AM, Samuel Doyle <[hidden email]> wrote:
I am now seeing failures in my search when sorting. I have not made any changes to my code or data which had worked previously.

Query Failed [Failed to execute main query]]; nested: IOException[Can't sort on string types with more than one value per doc, or more than one token per field]; ]

is this something new?

Thanks

Reply | Threaded
Open this post in threaded view
|

Re: Sorting failing in latest master

Samuel Doyle
It is actually a lastname field and it is analyzed although it probably should not be.
It did work before however.

On Wed, Jul 14, 2010 at 4:20 PM, Shay Banon <[hidden email]> wrote:
Are you sorting on an analyzed field or a field that has several values within a document?

-shay.banon


On Thu, Jul 15, 2010 at 2:18 AM, Samuel Doyle <[hidden email]> wrote:
I am now seeing failures in my search when sorting. I have not made any changes to my code or data which had worked previously.

Query Failed [Failed to execute main query]]; nested: IOException[Can't sort on string types with more than one value per doc, or more than one token per field]; ]

is this something new?

Thanks


Reply | Threaded
Open this post in threaded view
|

Re: Sorting failing in latest master

kimchy
Administrator
It might have worked before (it actually depends on the Lucene version when it worked), but, it does not make sense to sort on a field that is analyzed. So, either use a multi_field mapping, and add another mapping for last_name that is not analyzed (and name it something like lastNameSortable), or have the actual last name not analyzed.

-shay.banon

On Thu, Jul 15, 2010 at 2:26 AM, Samuel Doyle <[hidden email]> wrote:
It is actually a lastname field and it is analyzed although it probably should not be.
It did work before however.


On Wed, Jul 14, 2010 at 4:20 PM, Shay Banon <[hidden email]> wrote:
Are you sorting on an analyzed field or a field that has several values within a document?

-shay.banon


On Thu, Jul 15, 2010 at 2:18 AM, Samuel Doyle <[hidden email]> wrote:
I am now seeing failures in my search when sorting. I have not made any changes to my code or data which had worked previously.

Query Failed [Failed to execute main query]]; nested: IOException[Can't sort on string types with more than one value per doc, or more than one token per field]; ]

is this something new?

Thanks



Reply | Threaded
Open this post in threaded view
|

Re: Sorting failing in latest master

Samuel Doyle
Cool, thanks!

S.D.

On Wed, Jul 14, 2010 at 4:34 PM, Shay Banon <[hidden email]> wrote:
It might have worked before (it actually depends on the Lucene version when it worked), but, it does not make sense to sort on a field that is analyzed. So, either use a multi_field mapping, and add another mapping for last_name that is not analyzed (and name it something like lastNameSortable), or have the actual last name not analyzed.

-shay.banon


On Thu, Jul 15, 2010 at 2:26 AM, Samuel Doyle <[hidden email]> wrote:
It is actually a lastname field and it is analyzed although it probably should not be.
It did work before however.


On Wed, Jul 14, 2010 at 4:20 PM, Shay Banon <[hidden email]> wrote:
Are you sorting on an analyzed field or a field that has several values within a document?

-shay.banon


On Thu, Jul 15, 2010 at 2:18 AM, Samuel Doyle <[hidden email]> wrote:
I am now seeing failures in my search when sorting. I have not made any changes to my code or data which had worked previously.

Query Failed [Failed to execute main query]]; nested: IOException[Can't sort on string types with more than one value per doc, or more than one token per field]; ]

is this something new?

Thanks




Reply | Threaded
Open this post in threaded view
|

Re: Sorting failing in latest master

kimchy
Administrator
Just to explain a bit more, what you ended up with when sorting on a field that is analyzed (on recent Lucene version, before it was throwing a similar exception) is just sorting on the first term that got tokenized from the field. Many times its not really what you want.

I have reimplemented sorting in 0.9 (so it uses the same data facets use, and script fields) for better memory management, and currently its easier for me to simply throw an exception in this case. I might revisit this decision later on and allow to sort on fields that have multiple terms, but it will still only use the first term, which, as mentioned above, does not make sense most of the times.

-shay.banon

On Thu, Jul 15, 2010 at 2:35 AM, Samuel Doyle <[hidden email]> wrote:
Cool, thanks!

S.D.


On Wed, Jul 14, 2010 at 4:34 PM, Shay Banon <[hidden email]> wrote:
It might have worked before (it actually depends on the Lucene version when it worked), but, it does not make sense to sort on a field that is analyzed. So, either use a multi_field mapping, and add another mapping for last_name that is not analyzed (and name it something like lastNameSortable), or have the actual last name not analyzed.

-shay.banon


On Thu, Jul 15, 2010 at 2:26 AM, Samuel Doyle <[hidden email]> wrote:
It is actually a lastname field and it is analyzed although it probably should not be.
It did work before however.


On Wed, Jul 14, 2010 at 4:20 PM, Shay Banon <[hidden email]> wrote:
Are you sorting on an analyzed field or a field that has several values within a document?

-shay.banon


On Thu, Jul 15, 2010 at 2:18 AM, Samuel Doyle <[hidden email]> wrote:
I am now seeing failures in my search when sorting. I have not made any changes to my code or data which had worked previously.

Query Failed [Failed to execute main query]]; nested: IOException[Can't sort on string types with more than one value per doc, or more than one token per field]; ]

is this something new?

Thanks