# Technical Details

**Advanced Search Template**&#x20;

There is a page template named ***Advanced Search***. Applying this template to any Page will enable the feature on the page. &#x20;

<figure><img src="/files/4UXz7Z0xslWyYrAHWCfS" alt=""><figcaption></figcaption></figure>

**Template file page-advanced-search.php and SearchPageAdv.php File** &#x20;

This is the main file template page which calls **SearchPageAdv.php** file and the **SearchPageAdv.php** file contains all the functions that actually perform all search operations. &#x20;

**Location of SearchPageAdv:**&#x20;

*/www/wp-content/themes/{THEME-FOLDER}/src/ViewModels/SearchPageAdv.php*&#x20;

&#x20;

**Facets**&#x20;

Facets are the **Indexfields** mentioned in OC Admin dashboard. It is a variable name and meta data of articles. Each article contains some values for these facets, *e.g. An article has a facet field named **Section** and its value is **Sports**. So once one will search articles of **Sports** the article may appear in search result.*&#x20;

<figure><img src="/files/iMF00xUtrR0yEtYpyJcY" alt=""><figcaption></figcaption></figure>

**Config JSON file**&#x20;

The config JSON file contains all the key values that one wanted to include in facets. Like, if you need to add 3 facets/filters on Search page then you need to mention all three *Indexfields* in this JSON file.  &#x20;

In this JSON file you can mention what values of facets (filters) you need to show on screen. &#x20;

<pre class="language-xml" data-overflow="wrap"><code class="lang-xml"><strong>{ "facet": { "facetItems": { "Section": { "Name":"Section", "fieldName":"lvsection", "IncludedFieldsStatus":"FALSE", "IncludedFields":[ "Sport", "News", "Entertainment", "Business", "Finance" ] }, "ConceptCategoryUuids": { "Name":"Category", "fieldName":"lvcat", "IncludedFieldsStatus":"FALSE", "IncludedFields":[ "b0184795-0887-4620-9d11-f3a66e72ac42", "bad9a923-f480-4c99-83f6-61049558ad5e", "086b5ea1-9527-4907-869a-b04285f9cd00", "2c24dca5-3f7a-4983-b070-ee403f37fbc3", "7703b196-5d51-4c05-9c7d-6dac2af02559" ] }, "Channels": { "Name":"Channels", "fieldName":"lvchannels", "IncludedFieldsStatus":"FALSE", "IncludedFields":[ "Lavender", "Nigella", "Zinnia", "The Insurer", "Detroit Free Press", "Lancashire Post" ] } } } }
</strong></code></pre>

1. "Section" and "Channels" are the field names displayed in the Advanced Search Page as facets.
2. "Name":"Section" is the label used as the heading for each facet.
3. "fieldName":"lvsection" defines the attribute name for input fields in the URL of the Advanced Search Page.
4. "IncludedFieldsStatus":"TRUE"
   1. When "IncludedFieldsStatus" is set to TRUE:\
      The values listed in "IncludedFields" will be displayed in the facets.
   2. When "IncludedFieldsStatus" is set to FALSE:\
      The values specified in "IncludedFields" will be ignored.\
      All values will be shown in the facets, regardless of what is specified in "IncludedFields.
5. "IncludedFields" is used to add facet values for each index field. You can provide these values using either UUID or Name.

\**The above points mentions "fieldName":"lvsection" where the example is taken for lavendar project, in other cases this will change based on the project.*

In future if one more facet needs to be added then just adding details in JSON file will create front-end interface along with the back-end query for the new facet. JSON structure can be changed from customer to customer and accordingly codes need to change. \
\
**NGINX Settings:**\
\&#xNAN;**(To set the max-age = 0 for caching)**\
\
\&#xNAN;*Note:here location \~ ^/(advanced-search/) will be based on title of the advanced-search template page(Example: for "Page AdvSearch" title it will be location \~ ^/(page-advsearch/)*&#x20;

```
location ~ ^/(advanced-search/) {
  # This disables the monitoring.
  fastcgi_param PHP_VALUE "newrelic.browser_monitoring.auto_instrument=0";
  # This disables the caching.
  header_filter_by_lua_block {
    ngx.header["Cache-Control"] = "max-age=" .. 0
    ngx.header["expires"] = -1
        ngx.header["disablecaching"] = 1
  }
  # The rest is to be consistent with the server vars etc are the same as for the usual PHP location.
  include common/fastcgi_params;

  fastcgi_param SCRIPT_NAME           "/index.php";
  fastcgi_param DOCUMENT_URI          "/index.php";

  fastcgi_param SCRIPT_FILENAME       $document_root/index.php;
  fastcgi_index index.php;
  fastcgi_pass php-fpm;
}
```

&#x20;

**Customer/Deployed Environments List: WBM Stage**


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.navigaglobal.com/everyware/feature-advanced-search/technical-details.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
