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

Added Front End

Discussion in 'XenForo Development Discussions' started by seojoseph, Dec 17, 2013.

  1. seojoseph

    seojoseph Member

    We've added a custom built front end with new components like marketplace, blog, glossary, etc, etc. This is all integrated with xenforo.

    We have elastic search and the developer is wondering how elastic search is storing documents. The code isnt overriding the save functionality of xenforo.

    Any input?
     
  2. Jeremy

    Jeremy XenForo Moderator Staff Member

    As long as the add-on uses a proper search handler, the content should still be searchable.
     
  3. seojoseph

    seojoseph Member

    but this isn't an add-on. This is a lavaral front end custom CMS/Marketplace using xenforo's users, extended the likes, added dislikes, participation points, etc, etc done the proper way. Its really a beautiful masterpiece. Created a library in xenforo for the integration to laveral.

    So how is elastic search is storing documents? Where in the search handler does it 'talk with' with elastic search to say, put here.
     
  4. Jeremy

    Jeremy XenForo Moderator Staff Member

    Was the content searchable via XenForo prior to installing ES?
     
  5. seojoseph

    seojoseph Member

    Yes - content is searchable. The forum stuff but we want to add new content for the users to search. If you want I can add you on the repository and show you the site? Do you have bitbucket?
     
  6. seojoseph

    seojoseph Member

    We found it in library/XenES. now we're trying to do simple queries. lol.. its gonna be a long day
     
  7. seojoseph

    seojoseph Member

    So it seems that elastic search just replies with the type and id, then it uses mysql to fetch the actual data. how do you display different types of documents?
     
  8. seojoseph

    seojoseph Member

    Hmm it seems it doesnt pull the source of the document, so no data is shown. only index,type,id and score. kinda useless. What are we missing? @Brogan , @Kier or @Mike do you mind jumping in on this?
     
  9. AndyB

    AndyB Well-Known Member

    You can see the ElasticSearch index using the following command:

    Code:
    curl -XGET 'http://localhost:9200/xenforo113/_mapping?pretty=true'
    
    Replace xenforo113 with the name of your database name.

    The result of this command is:

    Code:
        {
          "xenforo113" : {
            "post" : {
              "_source" : {
                "enabled" : false
              },
              "properties" : {
                "date" : {
                  "type" : "long",
                  "store" : "yes"
                },
                "discussion_id" : {
                  "type" : "long",
                  "store" : "yes"
                },
                "message" : {
                  "type" : "string"
                },
                "node" : {
                  "type" : "long"
                },
                "thread" : {
                  "type" : "long"
                },
                "title" : {
                  "type" : "string"
                },
                "user" : {
                  "type" : "long",
                  "store" : "yes"
                }
              }
            },
            "profile_post" : {
              "_source" : {
                "enabled" : false
              },
              "properties" : {
                "date" : {
                  "type" : "long",
                  "store" : "yes"
                },
                "discussion_id" : {
                  "type" : "long",
                  "store" : "yes"
                },
                "message" : {
                  "type" : "string"
                },
                "title" : {
                  "type" : "string"
                },
                "user" : {
                  "type" : "long",
                  "store" : "yes"
                }
              }
            },
            "thread" : {
              "_source" : {
                "enabled" : false
              },
              "properties" : {
                "date" : {
                  "type" : "long",
                  "store" : "yes"
                },
                "discussion_id" : {
                  "type" : "long",
                  "store" : "yes"
                },
                "message" : {
                  "type" : "string"
                },
                "node" : {
                  "type" : "long"
                },
                "thread" : {
                  "type" : "long"
                },
                "title" : {
                  "type" : "string"
                },
                "user" : {
                  "type" : "long",
                  "store" : "yes"
                }
              }
            }
          }
        }
    
    This will give you an idea the of the data that ElasticSearch is indexing.
     
    Brandon Sheley and seojoseph like this.
  10. seojoseph

    seojoseph Member

    Awesome @AndyB - that helps a lot. I have a question for you or anyone else.. how does Elastic Search know what to score something? For example we've extended the default like and added dislikes as well as we have new "hubs" - We also plan on adding more like disagree, informative, funny, old.. which is inspired by http://xenforo.com/community/resources/post-ratings-taking-likes-to-the-next-level.410/ - so if we want to score posts using new 'ratings' where is that handled.. xenforo methods/classes or in elastic search? How do you hook into that? Maybe the score basically relevance but we would like to see whats it doing there exactly.
     
  11. AndyB

    AndyB Well-Known Member

    ElasticSearch knows nothing about your modifications. It only indexes what I show in post #9.

    Is there a separate table that stores the data? Or were fields added to the xf_post table?
     
  12. Jeremy

    Jeremy XenForo Moderator Staff Member

    As long as you add a proper search handler, and update the indexes properly, Elastic Search will return and index the data.
     
  13. seojoseph

    seojoseph Member

    Yes everything is set and stored in a different table.
     

Share This Page