mdBook icon indicating copy to clipboard operation
mdBook copied to clipboard

No search results when there are

Open tesuji opened this issue 5 years ago • 4 comments

For example: https://doc.rust-lang.org/nightly/reference/expressions/if-expr.html?search=if%20let image

tesuji avatar Jul 25 '20 07:07 tesuji

Unfortunately if and let are stop words ((src)[https://github.com/mattico/elasticlunr-rs/blob/beedaf86038839b07df007b0f7cf8417e4414956/src/lang/en.rs#L22-L33]), so they aren't indexed.

I think it is possible to define a custom pipeline in elasticlunr, but I fear that removing the stop words would result in noticeably worse search results (and maybe a much larger index?). Perhaps if search.use-boolean-and were true it wouldn't be so bad, but the default is false, and I'm not really sure if it would be wise to change that.

ehuss avatar Jul 28 '20 04:07 ehuss

Is there a way to search in table content (sections listing) only? That might reduce the index and create more correctly search result.

tesuji avatar Jul 28 '20 04:07 tesuji

I don't think so, I believe it can only boost the ranking of different things.

ehuss avatar Jul 28 '20 18:07 ehuss

the default is false, and I'm not really sure if it would be wise to change that.

I find current behavior surprising, so curious why not change the default to use-boolean-and = true... why would it be not wise?

tshepang avatar Feb 17 '23 16:02 tshepang