CloudCannon / pagefind

Static low-bandwidth search at scale
https://pagefind.app
MIT License
3.45k stars 111 forks source link

Example search documentation #547

Open ColeDCrawford opened 8 months ago

ColeDCrawford commented 8 months ago

It would be helpful to add some documentation for end users describing how to search Pagefind indexed sites. For example, it looks like the default search uses OR when there are multiple terms, but I don't know if that is documented anywhere (or if it can be changed). It looks like quoting for exact matches is supported but I also don't know if that is documented. Not sure if there is the possibility of anything more advanced like Elastic's simple query syntax?

ColeDCrawford commented 8 months ago

Some feedback from a PI for whom I am converting a Wordpress site to an SSG:

I tried the search and found it quite unforgiving: I tried to find Peter of Poitiers, who is the author of a text that appears on many medieval scrolls, and it returned all the “Peter”s, all the “of”s, etc. I learned that I had to search with quotes: should this have been obvious? I tried Zurich, and got nothing, and “Zürich” got me what I wanted; “Zuerich” got me only the word “zu.” It feels a little clunky at first.

bglw commented 8 months ago

Some overlap here: https://github.com/CloudCannon/pagefind/issues/329

Currently it is a little loose, and as such hard to document. Hoping to fix that! It is an AND for multiple terms, but if that fails to return any results it gets a little looser (and prefers returning something over nothing).

It looks like quoting for exact matches is supported

Correct! This one should definitely be documented.

Not sure if there is the possibility of anything more advanced like Elastic's simple query syntax?

Follow #329 for any updates on that 🙂

I tried to find Peter of Poitiers, who is the author of a text that appears on many medieval scrolls, and it returned all the “Peter”s, all the “of”s, etc. I learned that I had to search with quotes

This is an area Pagefind should be better at by default — it does try to prioritize words that are close together but other rankings can influence that.

I tried Zurich, and got nothing, and “Zürich” got me what I wanted

This will be fixed with #538. Though that won't cover Zuerich.


Overall good feedback! Hoping to address a lot of this in the medium term 🙂