Title Back Colour Keyoti Title Line Title Curve
Blue Box Top

Using content categories - SearchUnit - Forum

Welcome Guest Search | Active Topics | Log In | Register

Options
DMacy
#1 Posted : Thursday, June 15, 2017 5:20:48 PM
Rank: Advanced Member

Groups: Registered

Joined: 9/1/2010
Posts: 136
I have generated my index with content categories defined for many documents. One type of category consists of an "A" concatenated with a number. In my search box, I'm hard-coding one of these for testing.

Here is my search box definition:

Code:
  <keyoti:SearchBox ID="sbxLibSearchBox" runat="server" AutoCompleteQuery="True" AutoCompleteQueryFailSilent="True" AutoCompleteQueryMaxSuggestions="10"
      AutoCompleteQueryRunSearchOnSelect="True" AutoCompleteQueryShowNumberOfResults="True" CssClass="input-cont" OnSearch="sbxLibSearch_OnSearch" RememberQuery="True">
    <QueryTextBox ID="qtbLibSearchBox" runat="server" CssClass="text init" type="text" />
    <SearchButton ID="sbLibSearchBox" runat="server" CssClass="go" type="button" />
  </keyoti:SearchBox>


Here is the OnSearch event handler:

Code:
    Protected Sub sbxLibSearch_OnSearch(ByVal sender As Object, ByVal e As System.EventArgs)

      Dim SearchText As String = ""

      Dim SearchBox As Keyoti.SearchEngine.Web.SearchBox = CType(sender, Keyoti.SearchEngine.Web.SearchBox)
      If SearchBox IsNot Nothing Then
        Dim ContentCategoryArray As String() = {"A6"}
        SearchBox.SearchOptions = New Keyoti.SearchEngine.Search.SearchOptions("", ContentCategoryArray)

        SearchText = HttpUtility.HtmlDecode(SearchBox.QueryTextBox.Value)

        Response.Redirect(SearchResultsNavUrl(SearchText))
      End If

      Response.Redirect(Request.RawUrl)

    End Sub


The results don't seem to be taking this content category into effect. It represents the ID of a specific author, yet I'm getting results for lots of different authors. Is there a different way to do the search options?

Thanks!

Dan
DMacy
#2 Posted : Thursday, June 15, 2017 10:02:52 PM
Rank: Advanced Member

Groups: Registered

Joined: 9/1/2010
Posts: 136
I found where I can add the SearchOptions to the SearchAgent.Search call, and that worked. So my question is answered.
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.




About | Contact | Site Map | Privacy Policy

Copyright © 2002- Keyoti Inc.