elasticlunr.js icon indicating copy to clipboard operation
elasticlunr.js copied to clipboard

Searching Different on Safari, is it supported ?

Open harringtonp opened this issue 7 years ago • 6 comments

I have a search example which works in Chrome but not Safari. If you look at the results variable in the Safari screenshot you will see that the ref number goes from 0 upwards and the score is NaN. The exact same query in chrome shows ref fields with values I expect and scores that make sense.

Are there known problems with Safari, the search string "was" works in chrome. Safari doesn't fail on all searches, I've noticed that the string "mas" happens to work.

elasticlunr_chrome elasticlunr_safari

harringtonp avatar Jun 19 '17 20:06 harringtonp

Will just add that even though "was" could be a stop word I remove stop words with:

elasticlunr.clearStopWords();

and I remove the stemmer too:

var index = elasticlunr(); index.pipeline.remove(elasticlunr.stemmer);

harringtonp avatar Jun 19 '17 21:06 harringtonp

I have the exact same issue and also removed the stemmer and stop words.

xarg avatar Sep 13 '17 02:09 xarg

@harringtonp have you found a solution for this by any chance?

xarg avatar Sep 13 '17 02:09 xarg

@xarg Afraid I haven't. I do wonder though would the same issue arise in lunr. If you figure out what it is let me know

harringtonp avatar Sep 13 '17 21:09 harringtonp

For now the "fix" for me is: don't use Safari if you want to get search results - which is pretty lame to tell people to do.

@weixsong I'd like to fix this, but some hints at where to look would be appreciated. I'm not entirely sure where to start looking as I'm not familiar with the internals.

xarg avatar Sep 13 '17 21:09 xarg

@xarg I wrote my own search solution which was easy (in my case) and has no cross browser issues. Code at:

https://stackoverflow.com/a/46446723/7778427

harringtonp avatar Sep 27 '17 11:09 harringtonp