#community-help

Issues with Titles in Typesense Metadata

TLDR Vladimir could not get meta tags to work for titles in Typesense. Jason provided troubleshooting help and Vladimir resolved the issue by creating a "display: none" div.

Powered by Struct AI
+11
13
10mo
Solved
Join the chat
Oct 26, 2022 (11 months ago)
Vladimir
Photo of md5-7b8208683ba0167bf37013cf16be4f89
Vladimir
09:18 AM
Since Typesense is based on Algolia search, I followed a recommendation to put the needed information about component names in meta tags like this:

<meta name="version" class="version" content="1.5">
<meta name="title" class="title" content="Руководство программиста">

Unfortunately, it didn't have any effect. Can you give any advice on where Typesense is expecting to find group titles?
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
04:49 PM
Vladimir The titles are picked up by docsearch-scraper based on your docsearch configuration file. Here’s how to change the dom elements that gets scraped: https://docsearch.algolia.com/docs/legacy/config-file/#using-custom-selectors-per-page
04:50
Oct 27, 2022 (11 months ago)
Vladimir
Photo of md5-7b8208683ba0167bf37013cf16be4f89
Vladimir
11:02 AM
Not sure if I'm doing something wrong.

I moved the information required for the titles to the meta tag: &lt;meta name="context" content="5.5.1 Консоль управления Docsvision"&gt;

Then I edited the configuration file to match the edits:

"selectors": {
   "lvl0": {
      "global": true,
      "selector": "meta[name=\"context\"]"
   },

But I still can't see the titles. Is there something I did wrong?
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
01:01 PM
Did you also re-rerun the scraper after changing the config?
01:01
Jason
01:01 PM
If so, could you check the actual content of the fields in the Typesense collection, to see what DOM element is getting picked up for each selector?
Oct 28, 2022 (11 months ago)
Vladimir
Photo of md5-7b8208683ba0167bf37013cf16be4f89
Vladimir
07:09 AM
Yes, I re-run the scraper.

The actual content of the lvl0 selector field is null right now. Even though configuration file says "selector": "meta[name=\"context\"]" . The rest of the selectors have valid value.
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
03:21 PM
Are these meta tags being injected by JavaScript?
Oct 31, 2022 (11 months ago)
Vladimir
Photo of md5-7b8208683ba0167bf37013cf16be4f89
Vladimir
06:13 AM
No, those are just plain HTML meta tags added statically.
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
01:16 PM
I’m not sure what else could be wrong… I’d recommend running the scraper via a debugger and then stepping through the code to see why it’s not picking up those levels: https://github.com/typesense/typesense-docsearch-scraper
Nov 04, 2022 (10 months ago)
Vladimir
Photo of md5-7b8208683ba0167bf37013cf16be4f89
Vladimir
08:06 AM
I created a div with the required class and content, added it the property of display: none and it solved my issue. Thanks for reaching out to help.
+11
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
02:05 PM
Good to know!