• poturi

    (@poturi)


    Hi, we are looking for a plugin which can be used in multiple wordpress websites. We want to index all the wordpress sites pages,posts in one cloud search domain, so that we can display results from which the user is searching and also from the other sites. is it possible using this plugin? I see that this is working with one wordpress site and one cloud search domain. But not with multiple wordpress sites + one cloud search domain.

    waiting for your reply.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Andrea Landonio

    (@lando1982)

    Hi, the plugin should be perfect for you! By default, it works for single site WordPress but simply adding the same config in every site you can index data in one single domain, it works and has been tested in prod on heavy traffic sites.
    Unfortunately you cannot use the default search util (it works for single site) but you have to write a function that call apis for searching data through different sites (using single domain).. I can send you same examples if needed

    Thread Starter poturi

    (@poturi)

    Thank you for the quick reply, Yes, that would help us. can you please share some examples? I appreciate all your help.

    Plugin Author Andrea Landonio

    (@lando1982)

    Probably the best way for achieving that is to have some tests… step by step… just for start with some code.. you result page should call something like:

    $acs_result = acs_index_documents_search($keyword, ACS::TYPE_FIELD_DEFAULT, $start, $size, 'structured', $filter_query, true);
    $results = $acs_result->get_data();

    Then you can iterate over the results for displaying search data…

    You can find how “acs_index_documents_search” works directly in the plugin.. but in a nutshell you are calling CS with a keyword and a filter query using the “structured” parser and taking “$size” items from “$start” page. The final “true” means “perfom a global search”, so, over multisites..

    You can customize keyword and filetr query according to your need, like:

    $keyword = 'id:' . $id;
    or
    $keyword = 'title:' . $title;

    $filter_query = '(and post_status:\'publish\'';
    $filter_query .= ' (or 
    (and (or post_type:\'post\' post_type:\'your custom type\') site_id:' . ACS::get_instance()->get_site_id() . ') 
    )';
    $filter_query .= ')';

    but you can as many conditions as you want…

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Multi Site with single cloud search domain’ is closed to new replies.