skttl / umbraco-fulltextsearch8

Full Text indexing and searching for Umbraco 8 and Examine.
MIT License
19 stars 22 forks source link

SearchResults using ViewComponents #108

Closed poornimanayar closed 11 months ago

poornimanayar commented 11 months ago

Hi

I tried using this demo code in a ViewComponent and it is not returning me any result.

image

I tried using the exact same code in a View, injecting the FullTextSearchHelper and it works well.

image

Anything I am doing wrong?

Poornima

skttl commented 11 months ago

Hi Poornima, thanks for trying out my package :)

The second parameter of _searchService.Search() is for specifying which page of the search results you want, but you've put in the id of a published content. That could be why, although I'm not really sure what happens if you put in a pagenumber, that won't exist.

Also, the way you get you search terms from the querystring differs. Not sure if that means anything :)

poornimanayar commented 11 months ago

Hi Soren,

That might be why! Let me see. I mistook the demo code completely!

I love this package. I have used it in v7.

Poornima

poornimanayar commented 11 months ago

Yup! That was it! I mistook the current page to be the page in Umbraco. I should shut down my computer given my brain is not working! haha

The package is great Soren! No two ways about it :-)