1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Any Documentation or Tutorials for Extending Xenforo Search

Discussion in 'XenForo Development Discussions' started by gabarba, Jun 6, 2014.

  1. gabarba

    gabarba Member

    I just wanted to start off that I am new to Xenforo and I am diving into the deep end in terms of custom development for it. I have a background in PHP development specifically for e-commerce and custom development for small businesses. I don't really have any experience working on community sites or forums and I primarily work on Magento and Laravel applications and I am somewhat familiar with Zend Framework.

    So to get to the point, I need to integrate an existing Laravel application into Xenforo and vice versa. Specifically I want to be able to search for entities that exist in the Laravel application via the Xenforo search. I currently am in the works of dissecting an existing media library addon that extends the Xenforo search in a similar way to what I am trying to accomplish. I guess my question to you all is, does anybody have experience in this type of development and could lead me to some good resources and or give me any kind of tips or pointers so a I am not completely trying to solve this problem from scratch.

    I also wanted to know your thoughts if I should access my external Laravel application through RESTful API or by creating new Xenforo Addon that interacts directly with the Laravel application.

    Thanks for any insight on this matter. From the little time that I have spent with Xenforo I do say that it's a great piece of work.
  2. Daniel Hood

    Daniel Hood Well-Known Member

    You need to store your data that you would like to search in xf_search_index. Then you need to add your content type to the xf_content_type table along with the search_handler_class field in the xf_content_type_field table. Once you set your search handler classes, you should use these to manipulate searching for your data (set the metadata columsn to be searched and what not). If you look at the handler classes for threads and posts you should get an idea of how it's done.

    When you add content types and content type fields you have to rebuild the content type cache or they won't be recognized. You can do this by deleting the row for contentTypes from xf_data_registry.
  3. gabarba

    gabarba Member

    Thanks for the insight especially the part about rebuilding the content type cache. Funny thing happen after I created this thread I of course found what I was looking for 15 min after I posted it lol. I had been search around the internet for like 2 days with no luck and low and behold I find it right after I make my first post. For anybody else looking for this type of information here is the link.


    I will probably try to post a follow up tutorial with some example code on my Laravel and Xenforo integration.

Share This Page