Skip to content
This repository has been archived by the owner on Feb 9, 2022. It is now read-only.

[mdanalysis] no new search results after adding new sitemaps to sitemapindex #4699

Open
3 tasks done
orbeckst opened this issue Oct 6, 2021 · 10 comments
Open
3 tasks done

Comments

@orbeckst
Copy link
Contributor

orbeckst commented Oct 6, 2021

Bug: no search results after adding new sitemaps

If it is a DocSearch index issue, what is the related index_name ?

What is the current behaviour?

We added two new sitemaps to our siteindex (see Any other feedback below for details) for "distopia" and "pytng". Searching for new unique content does not give any results:

If the current behaviour is a bug, please provide all the steps to reproduce and screenshots with context.

To perform search, go to https://www.mdanalysis.org/ and use the search box as show in the screen shot:

algolia search example on mdanalysis.org

The screen shot shows that the unique term CalcBondsOrtho (for distopia) is not found, as explained in more detail below:

distopia content is not found

distopia failed example text

  1. search for "distopia"
  2. no exact results (only a fuzzy match in a blog post, which is not a correct match)

distopia failed example API docs

Note that this example probably fails because content is in a dl (definition list) with dt/dd tags:

  1. search for "CalcBondsOrtho"
  2. no results:

pytng content is not found

pytng failed example text

  1. search ' "TNG API" '
  2. No results found in pytng (only a blog post)

pytng failed example API docs

Note that this example probably fails to find the API doc because content is in a dl (definition list) with dt/dd tags, the text use should have been found

  1. search "TNGFileIterator"
  2. No results found

What is the expected behaviour?

Relevant pages from the distopia and pytng docs are found, as indicated above. (It was clearer to include the expected results above for the individual examples).

What have you tried to solve it?

  • checked that all xml files are correctly formed with
  • waited one week to give the algolia crawler time to pick up changes
  • checked that the new content still uses the same selector descriptors that are in the config file (the docs are produced in the same way as most of our other docs with the sphinx documentation generator)
    • still uses the same levels and p, li tags for most of the content
    • HOWEVER. some content (technical API docs) also uses definition lists (dl, dt/dd), and the dt tags are not configured as selectors for text yet. (The dd should be ok because the text is wrapped in p tags.)
    • also uses pre tags for code samples

Any quick clues?

Some content (for example, the API docs in https://www.mdanalysis.org/distopia/api/distopia.html) are stored in definition lists (dl with dt/dd elements) and the dt tags are NOT included as selectors in the algolia config file yet. (see PR #4700)

However, no idea why standard text is not appearing; seeing the scraper output might help but that requires algolia staff help.

Any other feedback / questions ?

We added two new sitemaps to our sitemap index https://www.mdanalysis.org/sitemapindex.xml for

<sitemap>
<loc>https://www.mdanalysis.org/pytng/sitemap.xml</loc>
</sitemap>
<sitemap>
<loc>https://www.mdanalysis.org/distopia/sitemap.xml</loc>
</sitemap>

Our open issues:

orbeckst added a commit to orbeckst/docsearch-configs that referenced this issue Oct 6, 2021
* new text selectors for definitions (dt tags) in dl (definition lists) as used in the sphinx-generated API docs (to index the function/class names themselves);
  dd (data tags) do not need a selector because text content is wrapped in p tags inside the dd and is already selected
* new text selectors for pre (code blocks)
* see issue algolia#4699
@orbeckst
Copy link
Contributor Author

orbeckst commented Oct 7, 2021

  • created algolia account to have access to dashboard and possibly see index
  • emailed support to ask how to link mdanalysis index to my dashboard and/or get access to the new(?) Crawler management interface to see(?) the index

@shortcuts
Copy link
Member

emailed support to ask how to link mdanalysis index to my dashboard and/or get access to the new(?) Crawler management interface to see(?) the index

Users will receive access to the new infrastructure on a random basis. Sorry, we are a bit early in the process right now to do bigger batches/deploy certain configs! You can read more here: https://docsearch.algolia.com/docs/migrating-from-legacy#migration-seems-to-have-started-but-i-dont-have-received-any-emails

created algolia account to have access to dashboard and possibly see index

We don't grant access to the dashboard but only the Analytics, sorry! (But it will be available in the new infra :D)

Missing pages

start_urls and stop_urls works as matching pattern/substring detection, so this URL for example https://www.mdanalysis.org/distopia/index.html will be skipped because of this stop_urls: https://www.mdanalysis.org/.*index.html$.

I'd suggest you to adapt the stop_urls to make sure we don't exclude URLs you'd potentially like to keep!

Below, the URLs matching distopia:
Screenshot 2021-10-08 at 15 54 10

We can see that some selectors don't match certain pages. To make it more specific, you can use selectors_key

No index

There's was a typo in your config (sorry I didn't saw it), I've fixed it in: #4712

@shortcuts
Copy link
Member

  • previous crawl: 67k records
  • new crawl: 85k records

@orbeckst
Copy link
Contributor Author

orbeckst commented Oct 9, 2021

I installed the docsearch-scraper locally and I’m able to run it so I can now debug more easily.

@orbeckst
Copy link
Contributor Author

orbeckst commented Oct 9, 2021

Well... maybe not that simple:

$ ./docsearch run ../docsearch-configs/configs/mdanalysis.json
...
algoliasearch.exceptions.RequestException: Record quota exceeded. Change plan or delete records.

Nb hits: 10415
previous nb_hits: 85975

Will need to see how to work within these limitations.

@orbeckst
Copy link
Contributor Author

I am now using a scraper with disabled index submission for testing, see orbeckst/docsearch-scraper#1.

@shortcuts
Copy link
Member

I am now using a scraper with disabled index submission for testing, see orbeckst/docsearch-scraper#1.

That's a good idea! It would be nice to see it as an option indeed

Let me know if I can help you debug your issue

@orbeckst
Copy link
Contributor Author

Many of the missing terms are due to broken sitemaps. Apparently, somewhere our Sphinx + GitHub actions based doc deployment changed and the sitemaps now contain a version information that is not actually present in the deployment URL. That's a problem on our end.

I'll leave this issue open for the moment.

@orbeckst
Copy link
Contributor Author

PR #4751 addresses some of the problems and we also fixed sitemaps. The PR has some more comments on what still seems to be missing, including the output from the scraper (for 0 record pages). Any insights why we're still missing content would be appreciated. Thanks!

@orbeckst
Copy link
Contributor Author

As mentioned in PR #4751 there are still a number of "0 records" pages, namely under

From #4751 (comment) :

When pages are retrieved but without records, it's usually related to the selectors.

Testing document.querySelectorAll("[itemprop='articleBody'] > .section h1, .page h1, .post h1, .body > .section h1"); on https://www.mdanalysis.org/GridDataFormats/gridData/basic.html for example, returns no results.

You can either make your selectors broader (we often go with .class heading) to also retrieve content form these pages, or add a new selectors_key field in the start_urls

Debugging the selectors is the next step...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants