Hi,
i use DNN 4.8 for a small time and i see that the search engine have a weird behavior when it tries to indexing some contents from modules that are included into more than one page.
This is the scenario:
- I have the same module into two page of my portal, so i have two records into TabModule table with the same ModuleID.
- Into SearchItem i have the indexed content of this module
- When i syndacate (or search) this module content, i have a couple of records into the result of SP "GetSearchItems"
Now, i resolve this with another method into SearchItemCollection class.
this method check if into the SearchItemCollection there is another item with the same ItemId, i past below the code of this method and a little changed that i have made into the method AddRange.
this is my method:
''' <summary>
''' Gets a value indicating whether the collection contains the specified <see cref="SearchItemInfo">SearchItemInfo</see>.
''' </summary>
''' <param name="value">The <see cref="SearchItemInfo">SearchItemInfo</see> to search for in the collection.</param>
''' <returns><b>true</b> if the collection contains the specified object; otherwise, <b>false</b>.</returns>
Public Function ContainsItemId(ByVal value As SearchItemInfo) As Boolean
' If value is not of type SearchItemInfo, this will return false.
Dim retValue As Boolean = False
If Me.List.Count > 0 Then
For Each item As SearchItemInfo In Me
If item.SearchItemId = CType(value, SearchItemInfo).SearchItemId Then
retValue = True
Exit For
End If
Next
End If
Return retValue
End Function 'Contains
A little change that i have made to the AddRange Method:
''' <summary>
''' Copies the elements of the specified arraylist to the end of the collection.
''' </summary>
''' <param name="value">An arraylist of type <see cref="SearchItemInfo">SearchItemInfo</see> containing the objects to add to the collection.</param>
Public Sub AddRange(ByVal value As ArrayList)
For Each obj As Object In value
If TypeOf obj Is SearchItemInfo And Not ContainsItemId(CType(obj, SearchItemInfo)) Then
Add(CType(obj, SearchItemInfo))
End If
Next
End Sub
Another way to resolve this bug? or weird behavior?
One of this could be change the SP GetSearchItems, but for now don't want to do this.
Bye
Gabriele
p.s. Sorry for my english