1

I'm using JS-Search to client-side search on GatsbyJS, I have a page of documentation with a lot of sections and some section has long text.

when I make a search the result is the text of the section with highlight marks on matches words

enter image description here

I would like to know if it's possible to get a smaller text as result? I look at the JS-Search but I couldn't find anything. Any suggestions here?

Note: By resume, I mean for example in the image you can see a paragraph with 7 lines but in only 2 lines have highlighted content, would be better only to show the sentences with highlighted contend.

Yoandry Collazo
  • 1,122
  • 9
  • 16
  • Could you explain what means "smaller text as result"? – ShinaBR2 Oct 01 '20 at 02:57
  • Hi ShinaBR2, I just edit my question to add what I mean with smaller text as result. – Yoandry Collazo Oct 02 '20 at 01:58
  • Looked at js-search documentation, they support you search, but neither do anything on the original text nor return the "result in the original text" (highlighted strings). This is out of scope of js-search. Other than that, the number of lines of text depends on your words, your screen size and CSS also. There is no official way to achieve that, maybe you can do a CSS trick or so. – ShinaBR2 Oct 02 '20 at 04:39
  • Thank you, I was afraid of that, But I need to try width the community! – Yoandry Collazo Oct 02 '20 at 12:26

0 Answers0