DDMAL / CantusDB

A new site for Cantus Database running under Django.
https://cantusdatabase.org
MIT License
5 stars 6 forks source link

Cantus index `json-text` search is limited to 50 chants #1546

Open lucasmarchd01 opened 1 month ago

lucasmarchd01 commented 1 month ago

Something I noticed while re-implementing this feature using the json-text API instead of the search API:

  1. A search using https://cantusindex.org/search?t=alleluia&cid=&genre=All will result in 4916 chants. In the previous implementation we would parse the HTML returned from this search from the first 5 pages (or 500 chants) of the table to return to the user on the CISearchView.
  2. A search using https://cantusindex.org//json-text/alleluia will result in 50 chants. I think no matter what search you make, the maximum number of results it will return is 50. Using our new implementation with this API, we display up to all 50 of these results to the user, but this is significantly less than before.

Will this be a problem? We have a message on the CISearchView that says "If your chant is not included here, please add it into Cantus Index or contact the administrator" so I can imagine in some cases when a user doesn't find their chant they will be confused.

We can change this message to something like "Please note that the search results are limited to the first 50 chants. ..."

Originally posted by @lucasmarchd01 in https://github.com/DDMAL/CantusDB/issues/1391#issuecomment-2176157470

annamorphism commented 1 month ago

slightly related question: for multi-word searches, does it search e.g. "qui" AND "est" or the string "qui est"? (The first will give way more results than the second, so cutting it off at 50 is going to lose more information.)

lucasmarchd01 commented 1 month ago

slightly related question: for multi-word searches, does it search e.g. "qui" AND "est" or the string "qui est"? (The first will give way more results than the second, so cutting it off at 50 is going to lose more information.)

It looks like at https://cantusindex.org/search?t=qui+est&cid=&genre=All it gives the message "Search exact phrase: 'qui est'" So it searches the full string, with 1668 results.

Similarly, all the results on https://cantusindex.org//json-text/qui+est have the exact phrase "qui est" with 50 results so I don't think there's any change in the base functionality of the search, just the number of results.

Hopefully there is a query parameter to increase the number of results, we should ask Jan. I've tried adding ?page=2 similar to other pages on the site and that didn't work.