CMS Development

karensantana
Membro

Can i specify Blog's Id in Search URL as a search parameter?

Hello,

 

I'm having a lot of struggles dealing with the Search Module. I just want to retrieve blog post from only  ONE blog, not entire site. 

Can i put my blog ID in the search Url and how can accomplish that ?

Here is the function where i think it is possible to do it:

 

getSearchResults = function(){
    var searchUrl = "/_hcms/search?&term="+encodeURIComponent(searchTerm)+"&limit="+encodeURIComponent(TYPEAHEAD_LIMIT)+"&autocomplete=true&analytics=true&" + searchOptions();
    $.getJSON(searchUrl, function(data){
      if (data.results.length > 0) {
        fillSearchResults(data.results);
        trapFocus();      
      }
      else {
        emptySearchResults();
      }
    });
0 Avaliação positiva
2 Respostas 2
roisinkirby
Equipe de Produto da HubSpot
Equipe de Produto da HubSpot

Can i specify Blog's Id in Search URL as a search parameter?

Hey @karensantana can you please share a link to the blog / page(s) you are working on? @ndwilliams3 do you know if this is possible?

0 Avaliação positiva
ndwilliams3
Conselheiro(a) de destaque

Can i specify Blog's Id in Search URL as a search parameter?

I haven’t used the search api yet. Looking at the docs I don’t see blog Id as a parameter option. However, domain and path prefix are options, so you could Either of those to limit to a single blog.
0 Avaliação positiva