algolia / algoliasearch-jekyll

⚠ DEPRECATED Use jekyll-algolia instead.
https://community.algolia.com/jekyll-algolia/
MIT License
125 stars 12 forks source link

Using "removeWordsIfNOResults" setting parameter does not seem to work #63

Closed dragospopa closed 6 years ago

dragospopa commented 6 years ago

I have been trying to use the removeWordsIfNOResults in the _config.yml file in order to handle the "No results" case and improve the search experince of the user.

As I have found it here and based on the documenttion you provided, I thought that the way to make it work with the algolia jekyll plugin is to configure it as follows:

algolia:
  settings:
      removeWordsIfNoResults: 'lastWords'
  application_id: '#######'
  index_name:    '#######'
  record_css_selector: 'p,ul'

Even so, the search seems to have not improved in any way and it is showing the same "No results" for the same queries.

Any idea what am I doing wrong or whether this is not something supported by the plugin yet?

Haroenv commented 6 years ago

You can check in your dashboard if it applied, but it should have, can you show where your search is? What will help too is your appID (if you don't want to disclose it publicly: support@algolia.com)

dragospopa commented 6 years ago

Hi there - thank you for the fast reply.

Do you know how/where can i check from dashboard if it had been applied or not? Searching my index from the algolia dashboard is still not working the expected way.

Haroenv commented 6 years ago

You can find the value of removeWordsIfNoResults in the ranking tab of "indices"

dragospopa commented 6 years ago

Not updated, but I managed to set it manually in there and it works perfectly 👍 thank you!

pixelastic commented 6 years ago

Could you tell us the version of the Jekyll plugin you are using?

dragospopa commented 6 years ago

version 0.9.0 - honestly, i can't seem to be able to use anything nested under settings in my yml. distinct is not changing anything either.

algolia:
  settings:
    attributeForDistinct: 'title'
    distinct: true
    removeWordsIfNoResults: 'lastWords'
  application_id: '#######'
  index_name:    '#######'
  record_css_selector: 'p,ul'
Haroenv commented 6 years ago

Can you share a repo with a reproducible example @dragospopa ?

dragospopa commented 6 years ago

Sure: the dev branch of this repo has algolia enabled. I need to use distinct because one of the pages seems to be too big to be pushed and I get a HTTP Error for record too big.

pixelastic commented 6 years ago

That is weird because distinct is enabled by default.

The plugin will split each page in several records (one per paragraph by default), and push those records. It will enable a distinct on the url field so only the most relevant paragraph of each page will ever be retrurned.

I've been working on an updated version of the plugin, that should be released in the coming weeks. I'm going to make sure your issue is solved in that version, using the repo you provided.

Thanks for reporting the issue!

pixelastic commented 6 years ago

I've cloned your repo and gave it a try on my side (using the new jekyll-algolia plugin).

Everything is working, I can see all your custom setting changes in the Algolia dashboard correctly set: image image

You can see the changes I made here: https://github.com/pixelastic/help/commit/345786364f29874df762a0398adb9e71ce8751e2

I only tested if your settings were correctly indexed and they were \o/. There are a few other changes between the two plugins (such as the record_css_selector being renamed to nodes_to_index), though, that you should be aware of.

I'm still finalising the documentation, but you can find most of the information here: https://community.algolia.com/jekyll-algolia/getting-started.html

If you're still experiencing issues, don't hesitate to post on the jekyll-algolia issues.

Thanks!