Forum


HomeHomePremiumPremiumDevelopmentDevelopmentLucene SearchLucene Search
Previous
 
Next
New Post
2/1/2018 10:50 AM
 

Dear DNN Hero,

I am working on lucene search in Dnn 9.1.1. I found the few videos by Scott Wilkinson. I do not see few futures in dnn 9 such admin host etc as Scott mentioned. Is there any way, can I  get step by step lucene  search development in dnn 9 ? 

Please advise.

1 Reports 
New Post
2/8/2018 3:51 AM
 
Hello,

Good morning, I am following the Scott Vedio as below.
https://www.dnnhero.com/Premium/Tutorial/ArticleID/338/Customizing-Your-DNN-Search-Results-Part-3-3

I am confused in one step. I see Item.cs file. Attached is screen sort. 

MY question is, does this cs file related with lucene search ? is it required for lucene ?
[namespace MVCWEBAPI.Modules.MVCWEBAPI.Entities
{
    [TableName("WS_SearchContent_Items")]
    //setup the primary key for table
    [PrimaryKey("ItemId", AutoIncrement = true)]
    //configure caching using PetaPoco
    [Cacheable("WS_SearchContent_Items_", CacheItemPriority.Default, 20)]
    //scope the objects to the ModuleId of a module on a page (or copy of a module on a page)
    [Scope("ModuleId")]
    public class Item : IItemModel
    {
        ///<summary>
        /// The ID of your object with the name of the ItemName
        ///</summary>
        public int ItemId { get; set; }

        ///<summary>
        /// A string with the name of the ItemName
        ///</summary>
        //[ColumnName("ItemName")]
        public string ItemName { get; set; }

        ///<summary>
        /// A string with the description of the object
        ///</summary>
        public string ItemDescription { get; set; }

        ///<summary>
        /// An integer with the user id of the assigned user for the object
        ///</summary>
        public Nullable<Int32> AssignedUserId { get; set; }

        ///<summary>
        /// The ModuleId of where the object was created and gets displayed
        ///</summary>
        public int ModuleId { get; set; }

        ///<summary>
        /// An integer for the user id of the user who created the object
        ///</summary>
        public int CreatedByUserId { get; set; }

        ///<summary>
        /// An integer for the user id of the user who last updated the object
        ///</summary>
        public int LastModifiedByUserId { get; set; }

        ///<summary>
        /// The date the object was created
        ///</summary>
        public DateTime CreatedOnDate { get; set; }

        ///<summary>
        /// The date the object was updated
        ///</summary>
        public DateTime LastModifiedOnDate { get; set; }
    }
}
]
Do I need to use any particular table , view ,sp  for lucene search in my module ? or when i use Scoot API, does it effect on whole DNN
Database to make lucene search working.
Please aprove my this post ASAP. Please reply me . It would be greatly apreicated.

Thanks

 

 

 
New Post
2/9/2018 7:28 AM
 

Ami,

I think the confusion is the code in the DotNetNuclear.SearchContent is for this video: https://www.dnnhero.com/Premium/Tutor...

 

That project illustrates how to get your module's custom data into the lucene search by converting the Item model object to a SearchDocument to be indexed by lucene.  So for the proper context, listen to the that whole Search Integration tutorial to understand that.

 

The tutorial video you mentioned, https://www.dnnhero.com/Premium/Tutorial/ArticleID/338/Customizing-Your-DNN-Search-Results-Part-3-3, is referring to the example code DotNetNuclear_HandlebarsCustomResults....  This tutorial explains how to query the lucene index in a custom module.

 

Sorry for the confusion.  Let me know if you have more questions.

Thanks,
Scott

 

 

 
New Post
2/12/2018 4:09 AM
 

Hi Scott,

Good morning, Many thanks for the clarification. I truly appreciate your assistance. Your video explanation does help lots.

Still, I am confused, My requirement is , I want to do dynamic lucene search in Dnn. I have many Custom modules. I want to do one master search button on home page.

As you replied first search,  module's custom data into the lucene search by converting the Item model object to a Search Document to be indexed by lucene.

I have one MVC API Category list is ready. I am trying to follow your below link:
 .https://www.dnnhero.com/Premium/Tutorial/ArticleID/307/Search-Integration-Implement-SearchModuleBase-Part-3-4

Site Crawler -re indexing--
It comes on break point on this method[GetModifiedSearchDocuments]. But I do not see any data item. It does display only "0" 

Do i need to use search API in this ?
Please advise.

Second,
I did review the code DotNetNuclear_HandlebarsCustomResults demo I do not see that you used any Lucene search  API in it.

On the vedio screen, I see, you are explaling the lucene serach API but code behind in In this[DotNetNuclear_HandlebarsCustomResults demo] ,
  I do not see any implementation of Lucene API.

Do I need to implement the  lucene search API in this[DotNetNuclear_HandlebarsCustomResults] or Just what ever in code, I should follow that only , will it  display lucene search.
Your help would be greatly appreciated.  


[/// API that searches for items
        /// </summary>
        /// <returns></returns>
        [HttpPost, HttpGet]  //[baseURL]/item/search
        [ValidateAntiForgeryToken]
        [ActionName("search")]
        [DnnModuleAuthorize(AccessLevel = SecurityAccessLevel.View)]
        public HttpResponseMessage Search(SearchRequest request)
        {
            try
            {
                // Search lucene for only my module's search data
                SearchQuery query = new SearchQuery
                {
                    ModuleId = request.ModuleId,
                    PageSize = request.PageSize,
                    PageIndex = (request.PageNum > 0 ? request.PageNum : 1),
                    SortField = SortFields.Relevance,
                    SortDirection = SortDirections.Descending,
                    KeyWords = request.Term
                };
                SearchResults sr = SearchController.Instance.ModuleSearch(query);

                // Convert each search result to an Item
                List<Item> itemList = new List<Item>();
                foreach (SearchResult r in sr.Results)
                {
                    // Add module result if it is an item (items have a search doc description)
                    if (!String.IsNullOrEmpty(r.Description))
                        itemList.Add(FeatureController.ConvertSearchDocToItem(r));    
                }

                return Request.CreateResponse(HttpStatusCode.OK, itemList);
            }
            catch (Exception ex)
            {
                return Request.CreateResponse(HttpStatusCode.InternalServerError, ex.Message);
            }
        }

    }

    public class RequestItem
    {
        public int ItemId { get; set; }
        public string ItemName { get; set; }
        public string ItemDescription { get; set; }
        public int AssignedUserId { get; set; }
        public int CreatedByUserId { get; set; }
        public DateTime CreatedCreatedOnDate { get; set; }
    }

    public class RequestById
    {
        public int ItemId { get; set; }
    }

    public class SearchRequest
    {
        public string Term { get; set; }
        public int PageSize { get; set; }
        public int PageNum { get; set; }
        public int ModuleId { get; set; }
    }




Thank you!

 
New Post
2/12/2018 10:54 AM
 
Hi scott,

Good evening, Sorry to keep bothering you. I have been working on search from long time. I need to complete ASAP. I have dead line for this work.

Your all help would be greatly appreciated.

As per your last week replied, I downloaded the code from DotNetNuclear_HandlebarsCustomResults.

Only 2 pages. I did review your vedio for this [DotNetNuclear_HandlebarsCustomResults] code . Vedio link is [https://www.dnnhero.com/Premium/Tutorial/ArticleID/337/Customizing-Your-DNN-Search-Results-Part-2-3]

Now, Below, I am getting an error message. It looks like path error. I use my local computer .

{"Message":"No HTTP resource was found that matches the request URI 'https://dnndev.me/API/internalservices/searchService/search'.","MessageDetail":"No action was found on the controller 'SearchService' that matches the request."}

I am using dnn 9.1.1. Still, I am confused , is it Lucene or Custom search
When I run direct controller on  browser,for the testing purpose , Below , I see the messages.
http://dnndev.me/api/internalservices/searchService/search
404 Not Found
The requested Url does not return any valid content.
Administrators
Change this message by configuring a specific 404 Error Page or Url for this websit
http://dnndev.me/dnnSearchAPI.getServiceRoot/api/internalservices/searchService/search
Please advise.

 

Thank you!

 
Previous
 
Next
HomeHomePremiumPremiumDevelopmentDevelopmentLucene SearchLucene Search



Try FREE
30 days money back guaranteed