-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Update ESLint config (refs eslint/eslint.github.io#475) #440
Conversation
EDIT: Never mind, I think I see the answer-- I need to install the scraper and then use the playground utility. I'll make sure to test carefully! 😄 |
Thank you for the PR and for the details.
It is indeed the good way in order to understand what is going under the hood. I have updated your PR in order to makes it work with our tool. Feel free to review if you need further explanations. I have created a temporary index in order to let you try it out. You can also find it here ad a one page showcase This new index is only crawling the latest version as requested. The integration will follow these steps (credentials <!-- at the end of the HEAD -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css" />
<!-- at the end of the BODY -->
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js"></script>
<script type="text/javascript"> docsearch({
apiKey: '98dae3251234b5fa24ac3bfcb56b1a8d',
indexName: 'eslint_demo_475',
inputSelector: '### REPLACE ME ####',
algoliaOptions: { 'facetFilters': ["tags:$TAGS", "area:$AREA"] },
debug: false // Set debug to true if you want to inspect the dropdown
});
</script>
'facetFilters': ["tags:blog", "area:developer-guide"] |
Thanks @s-pace, greatly appreciate your time in helping to correct my PR as well as provide a demo index. I tried the showcase and one of our known search issues is resolved, so I'm more confident that this is what we need. Regarding the facet information:
Also: Could I ask you to take a quick look at eslint/archive-website#481 and make sure that looks sensible? This is the client-side change. |
You are welcome!
If you don't specify any facets, the scope of the search will be global. So yes you can remove the following line: algoliaOptions: { 'facetFilters': ["tags:$TAGS", "area:$AREA"] },
Good to foresee your need. You can use some combinations of different conditions. See the dedicated article on the algolia doc eslint/archive-website#481 commented. Please ping us when we need to merge the configuration from |
Thanks again @s-pace! I'd like to try the eslint_demo_475 index locally (using the "playground" on a clone of the scraper repo) this weekend. Once I've done that and everything looks good, I'll ask that this PR be merged and then merge the eslint/eslint.github.io PR as soon as I see this one merged. In the meanwhile, please continue to hold off on merging. Thanks! |
Hi @s-pace, I discovered a minor inconsistency in the new index (well, either that or an inconsistency in the configuration available to the showcase). Use case: I tried searching for the word "released", I expected to see blog posts on eslint.org announcing new software releases.
Looking at the eslint.json file, I'm actually not seeing any configuration about how to order certain types of results. The only thing I can think of is that on the current site, we do crawl the blog page (see https://eslint.org/blog) and the releases would appear most recent first, so maybe that's the order they go into the index normally. What I can't tell is if the new configuration in this PR is imposing a different order, or if this was just due to a limitation in the showcase. I'm sorry for asking so many questions. I'm okay with things not being exactly perfect on the first go-around, but I want to at least make sure I'm learning what I need to learn for DocSearch configuration so I can make little tweaks later. Thanks so much for your patience with me as I try to figure this out! |
No problem. The consistency between these indices isn't guaranteed. The current one isn't chronologically ranked nor the new one is. Is this something you want to do? If so, we will need a way to extract the date of the article from the webpage. This could be a meta named like Let me know if I get you well and that it is something you want to achieve: ordered result by date The demo isn't specific so far. |
Hi @s-pace, thanks for your explanation. At this point, I'm not going to worry about the chronological aspects. Let's just merge this in 😄 I'll deal with any problems that come up later. I'll be waiting for this to be merged, and then I can merge the eslint/eslint.github.io pull request. Thanks again! |
Hi @s-pace, thanks for merging this. Just one more question: Is there a status page or similar for when the official scraper has run and built indexes? Just wondering in case I need to track when the scraper is run or if I didn't think the index was being built successfully. I've done some Googling but haven't found such a page yet-- maybe I'm using the wrong terms. Thanks! |
Refs eslint/archive-website#475.
Pull request motivation(s)
Change ESLint config so that by default, it will index only latest documentation (and not historical documentation from older versions).
What is the current behaviour?
Currently, the docsearch autocomplete (on our ESLint website repo) assumes that we should be faceting on "version:3.0.0" content. However, we actually have no real need to index old versions of content at this point (although this could change later). As a result, some search results are broken.
What is the expected behaviour?
Hoping to fix the search results by structuring things a little more sensibly 😄
NB2: Any other feedback / questions?
This is my first time working on docsearch, so I would be grateful for any feedback or suggestions.
If this is something that the docsearch/algolia maintainers should be doing exclusively, please close this and forgive my wasting your time.
Also, could we hold off on merging right away? I need to create a PR on our site and link it over here. Once the ESLint folks and any generous docsearch folks take a look and make sure all is well, then we can merge both this PR and the ESLint site PR and hopefully be good to go for the next crawl.