0

I have a manticore index with the following configuration:

index book_archive {
    type = rt
    path = /book_archive
    rt_field = title
    rt_field = author
    charset_table = non_cjk, cjk
    stored_fields = title, author
}

I am trying to do a full text search, and order the results by the column, alphabetically. The following is an example query I am trying to use:

SELECT id,title FROM book_archive WHERE MATCH('(@title Test) ') ORDER BY title DESC LIMIT 20;

However, this is not properly sorting the results. After reading the documentation some more, it seems default ordering is by search weight. Is there any way to have the results sorted by alphabetical order, similar to a postgres or mysql text column?

tmello01
  • 109
  • 1
  • 3
  • 11

1 Answers1

0

You can't sort be field, even stored ones.

Fields are designed for text matching, and stored fields are designed for retrieving only. Sorting would mean fetching every title that docstore not designed for.

Instead put the title as attribute then would be able to sort. No point storing if attribute

Can just create as both

rt_field = title
rt_attr_string = title
barryhunter
  • 20,886
  • 3
  • 30
  • 43