Closed borisschapira closed 9 years ago
Note: I could not find an example on your demo as all the article have the same URL as their title.
Hello,
The search is only done in your attributesToIndex
, and by default url
is not part of it. You can define a custom list of attributesToIndex
in your _config.yml
file, under the algolia.settings
option.
The default list of attributesToIndex
is %w(title h1 h2 h3 h4 h5 h6 unordered(text) unordered(tags))
. The order of the attributesToIndex
is important. Records with a match in a key at the top will be returned before records with a match in a key at the bottom. Here is how I would do it:
algolia:
application_id: XXXX
[...]
settings:
attributesToIndex:
- title
- h1
- h2
- h3
- h4
- h5
- h6
- unordered(text)
- unordered(tags)
- unordered(url)
This should fix your issue :)
Oh, actually, using slug
instead of url
might even be better. When using url
a lot of pages might match when searching for html
Thanks, it works like a charm. Maybe you should add what you just explained to the plugin documentation ?
Yes, good idea. I just updated the documentation : https://github.com/algolia/algoliasearch-jekyll#settings
Thanks for the feedback
Nice, thank you !
Content URL are clearly indexed, but not looked during a search. That could be problematic if URL is not exactly the slug of the article title.
For exemple, this post : http://borisschapira.com/2014/05/sud-web-2014-de-lidee-au-projet-notes is well indexed. But if you search on Algolia for "sud-web-2014-de-lidee-au-projet-notes", you'll never find it because of the "notes" wich is not in the title.