Search en Create an advances Search system for Drupal 8 with Search API. <span class="field field--name-title field--type-string field--label-hidden">Create an advances Search system for Drupal 8 with Search API.</span> <div class="clearfix text-formatted field field--name-field-question field--type-text-long field--label-above"> <div class="field__label">Question</div> <div class="field__item"><p>How to use advances search server like Solr, Elasticsearch, Database ... With a Drupal 8 site ?</p> </div> </div> <span class="field field--name-uid field--type-entity-reference field--label-hidden"><span lang="" about="/en/users/editor" typeof="schema:Person" property="schema:name" datatype="">editor</span></span> <span class="field field--name-created field--type-created field--label-hidden">Wed, 01/18/2017 - 12:03</span> <div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item"><h2>Search API and Database Search server.</h2> <p>1. Uninstall drupal basic Search<br /> 2. Install search_api and search_api_db<br />   NOTE : You can also use another database configures on settings.php<br /> 3. Add a Search Server (/admin/config/search/search-api/add-server).<br />   - Use "Database" as cackend server.<br /> 3. Add a Search Index (/admin/config/search/search-api/add-index).<br />   - Select Enteties (Data source) to index with this index and a search server.<br />   - Save and Add fields to Index. (Example : Title, Body file for "Contents").<br />   - Optionaly you can configure "Processors" as Filters, Data traitements ...<br /> 4. Enable the newly created "Index" then run indexing or queue indexing.<br /> 5. Create a view using your Index, and add field "Search: Fulltext search" as Exposed criteris filter.</p> <p>Once indexing is done, visit the view's page to use the search system.</p> <p> </p> <p><strong>Tips </strong>: For a quick start, just install the "Database Search Defaults" (), and configure your "Search Server", "Index" and "Search Pages" on.<br />  - Search API :        /admin/config/search/search-api<br />  - Search Views :    /admin/structure/views (Defaut : /admin/structure/views/view/search_content )</p> <p><em>NOTE : To create a server like Solr, Elasticsearch you need to install search server and the drupal module for those servers.</em></p> <p> </p> <p><code>#Some usefull Drush commands for the search api and facets<br /> #Enable search api<br /> drush pmu search -y<br /> drush en search_api search_api_db -y<br /> #Enable Facets<br /> drush en facets -y<br /> #Index and Re index<br /> drush search-api-index<br /> #OR<br /> drush sapi-i</code></p> <p> </p> <p>Enable Facets With search API (Example : Db serch)</p> <p>1. Enable search_api and search_api_db modules<br /> 2. Enable facets module for drupal 8<br /> 3. Create a Search server and Search Index (at last one search index)<br /> 4. Add fields for the index.<br />     -&gt; Index -&gt; Fields -&gt; "Add field"<br /> 5. Create a view to display your search index<br /> 6. Create a facet from /admin/config/search/facets -&gt; "add facet" (/admin/config/search/facets/add-facet)<br /> 7. Select your facet source (Search view) and Field.<br />     -&gt; For Tags or entity reference, enable '' and  ''<br /> 8. Configure the facet.<br /> NOTE : I got few <span lang="en" xml:lang="en" xml:lang="en"><span>problems</span></span> using /search as the search page path.</p> <p>Now you can see the facets on your search view</p> </div> <div class="field field--name-field-tags field--type-entity-reference field--label-inline clearfix"> <h3 class="field__label inline">Tags</h3> <ul class="links field__items"> <li><a href="/en/tags/drupal-8" hreflang="en">Drupal 8</a></li> <li><a href="/en/tags/search" hreflang="en">Search</a></li> <li><a href="/en/tags/module" hreflang="en">Module</a></li> </ul> </div> <div class="field field--name-field-related-contents field--type-entity-reference field--label-hidden field__items"> <div class="field__item"><a href="/en/tutoriels/273/solr-configuration-for-drupal" hreflang="en">Solr Configuration for Drupal</a></div> </div> <section class="field field--name-comment field--type-comment field--label-above comment-wrapper"> <h2 class="title comment-form__title">Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=284&amp;2=comment&amp;3=comment" token="GjVmaskhE-AMvP5dALObfK4_-KKa7f-L1OICRNPKZFg"></drupal-render-placeholder> </section> Wed, 18 Jan 2017 11:03:57 +0000 editor 284 at