Open bglw opened 1 year ago
Another option would be to swap out for different punctuation logic in segmented languages, so that in these cases a-b
is always 'a', '-', 'b'
.
Hi, I think the same problems occur with the symbol '
that can be placed in front of a word in French (it's the contraction of the article le
, which becomes l'
).
For example, a search for alphabet
should also return results in which l'alphabet
can be found.
Thanks in advance and congratulations on a very good job!
Hey @hjonin 👋
The French case is slightly different (in a good way) — this current issue only applies to non-whitespace-delimited languages like Chinese.
For indexing l'alphabet
, that will be resolved by #225 which will be released on a stable version next week 😄
The current v1.0.0-beta.2
release includes the behavior, though it currently doesn't split on the '
symbol. But you bring up a great point re:French, so I'll expand the logic to cover it (and probably just all punctuation for now, and we can configure it down later if need be).
Here's an example of the new word indexing finding the attribute
in html_attribute
:
Hi @bglw
Thank you very much for your answer! Can't wait to use the new version!
In whitespace-delimited languages, when Pagefind encounters
a-b
it will be indexed asab
. In languages that go through segmentation, this might have been first segmented to'a', '-', 'b'
which indexes as the wordsa
andb
with a word in between. This makes it hard to search for, as on the client-sidea-b
will continue to search forab
, and an exact search for"a b"
or"a - b"
won't match due to the ignored word indexed betweena
andb
.We don't have the segmentation available on the client due to bandwidth constraints, so a different solution will need to be found. One easy(ish) option would be for the client to search for
a-b
asab
anda b
.