Select the search type
  • Site
  • Web
Search
You are here:  Support/Forums
Support

Bring2mind Forums

Advance Search: How to incorporate advance search feature in template driven views
Last Post 04/16/2010 10:28 AM by Peter Donker. 3 Replies.
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
jsumant
New Member
New Member
Posts:20


--
03/20/2010 3:10 PM

I am evaluating DMX document. During evaluation I found that there is no way to show "Advance Search" option in template driven views. My requirement is to publish documents to anonymous users and for that I don't want to use default view of DMX module (i.e. ViewCollection.ascx) where Search option comes under Tools menu.

Is there any way to incorporate advance search feature in my customized view (TemplateView.ascx)?

Peter Donker
Veteran Member
Veteran Member
Posts:4536


--
03/23/2010 10:51 AM
Hi Sumant,

The planning is to have a separate search module in the future that does this. For now there is no integration in the templated view.

Peter
jsumant
New Member
New Member
Posts:20


--
04/13/2010 6:17 PM

Hi Peter,

I am trying to develop custom search control where I am using tabstrip UI similar to what appears in search pop-up control through Tools menu of ViewCollection.ascx control. But instead of using callback similar to ViewCollection.ascx, I want to bind search results on button click event. Please find the code written in button click event handler as follows:

Protected Sub lnkbtnSearch_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkbtnSearch.Click

        Select Case TabStrip2.SelectedTab().Value()
            Case "rawsearch"
                Dim strRaw As String = txtRawSearch.Text
                SearchController.Search(Me.PortalId, Session.SessionID, strRaw, Me.Settings.ModuleSettings.BaseRootId, True, True, True)
            Case "regularsearch"
            Case Else
                'quick search
                Dim strSearchTerm As String = txtQuickSearch.Text.Trim()
                Dim iCollectionId As Integer = Me.Settings.ModuleSettings.BaseRootId
                Dim lstSearchTerms As System.Collections.Generic.List(Of SearchTerm) = New System.Collections.Generic.List(Of SearchTerm)

                Select Case rblFields.SelectedValue
                    Case "all"

                    Case "core"
                        Dim obj As SearchTerm = New SearchTerm()
                        obj.Field = "Title"
                        obj.Inclusion = IncludeType.Include
                        obj.Join = JoinType.Or
                        obj.SearchString = strSearchTerm
                        obj.Tokenize = False
                        lstSearchTerms.Add(obj)
                    Case Else
                        Dim obj As SearchTerm = New SearchTerm()
                        obj.Field = "title"
                        obj.Inclusion = IncludeType.Include
                        obj.Join = JoinType.Or
                        obj.SearchString = strSearchTerm
                        obj.Tokenize = False
                        lstSearchTerms.Add(obj)
                End Select

                Select Case rblScopeQ.SelectedValue
                    Case "folder"
                    Case "all"
                        iCollectionId = Me.Settings.ModuleSettings.BaseRootId
                    Case Else
                        iCollectionId = Me.Settings.ModuleSettings.BaseRootId
                End Select

                SearchController.Search(Me.PortalId, Session.SessionID, lstSearchTerms, iCollectionId, True, True, True)

        End Select

        Dim objSearchController As Bring2mind.DNN.Modules.DMX.Services.Search.SearchController = New Bring2mind.DNN.Modules.DMX.Services.Search.SearchController()
        Dim results As Object = objSearchController.GetGridContents(Me.PortalSettings, Me.TabId, Me.ModuleId, Me.Settings.ModuleSettings, Me.UserInfo, Me.UserInfo.IsInRole("Administrator"), Session.SessionID)

        If CType(results, System.Data.DataView).Table.Rows.Count > 0 Then
            dgResults.DataSource = results
            dgResults.DataBind()
        End If

    End Sub

With this code I am not getting expected results. "results" object doesn't contain any records for the search.

If I put last few lines of code starting from objSearchController declaration in Page_Load of control and before requesting the page where custom search control is placed, I search for the term in DNN+DMX Search,records similar to what are displayed on DMX search page are displayed in custom search control.

Hence I came to a conclusion that either I am missing something in Search() call or not using proper API call for search.

Appreciate your valuable suggestion.

Peter Donker
Veteran Member
Veteran Member
Posts:4536


--
04/16/2010 10:28 AM

Hi Sumant,

I think this is the same question as here, no?

http://www.bring2mind.net...w/topic/Default.aspx

Peter

You are not authorized to post a reply.