Python wagtail Backends














































Python wagtail Backends



In the previous few article we have discuss about Search.If you have not gone through it you see through this link Search.In which i have discuss one of the most important think while writing that is Backends. In this article we learn more about Backends more.
INTRODUCTION TO BACKENDS

Wagtailsearch has support for multiple backends, giving you the choice between using the database for search or an external service such as Elasticsearch. The database backend is enabled by default. 

You can configure backend to use with the WAGTAILSEARCH_BACKENDS setting:
WAGTAILSEARCH_BACKENDS = {
'default': {
'BACKEND': 'wagtail.search.backends.db',
}
}

AUTO_UPDATE

By default, Wagtail will automatically keep all indexes up to date. This could impact performance when editing content, especially if your index is hosted on an external service.

The AUTO_UPDATE setting allows you to disable this on a per-index basis:

WAGTAILSEARCH_BACKENDS = {
'default': {
'BACKEND': ...,
'AUTO_UPDATE': False,
}
}

If you have disabled auto update, you must run the update_index command on a regular basis to keep the index in sync with the database.

ATOMIC_REBUILD

When the update_index  command is run, Wagtail deletes the index and rebuilds it from scratch. This causes the search engine to not return results until the rebuild is complete and is also risky as you can't rollback if an error occurs.

Setting the  ATOMIC_REBUILD  setting to True makes  Wagtail rebuild into a separate index  while  keep the old index active until  the new one is fully built. When the rebuild is finished, the indexes are swapped atomically and the old index is deleted.

                                                   Type of Backends

  • Database Backend:-
                   The database backend is very basic and is intended only to be used in development and on small sites.      It cannot order results by relevance, severely hampering its usefulness when searching a large collection of pages.

  • PostgreSQL Backend:-
                    If you use PostgreSQL for your database and your site has less than a million pages, you probably want to use this backend

  • Elasticsearch Backend:-
                   The Elasticsearch backend is compatible with Amazon Elasticsearch Service, but requires additional configuration to handle IAM based authentication. This can be done with the requests-aws4auth package.



More Articles of SAYENDEEP MAHANTY:

Name Views Likes
C++ Exception Handling-|| 86 3
C++ Exception Handling 116 3
C++ File Handling EOF 94 5
C++ File Handling Error Handling During file Operation 1135 5
C++ File Handling seekp() Function 106 5
C++ File Handling seekg() Function 105 6
C++ File Handling tellg() Function 127 5
C++ File Handling tellp() Function 133 5
C++ File Handling close() Function 78 5
C++ File Handling:: open() 107 5
C++ File Handling Introduction 131 5
C++ Container Library:: std ::array-II 102 4
Top Django Interview Questions and Answers You Need to Know 303 6
C++ Container Library::std::array 97 6
C++ Container Library Introduction 104 5
Essential Engineering Skills for Your Resume 127 5
Mistakes To Avoid During Technical Interview 133 5
Mistakes You Must Avoid During Work From Home 179 6
Seven Common Mistakes that Beginners Should Avoid While Learning to Code 109 6
Simple Linear Regression 96 6
Python wagtailmenus 123 6
Python wagtail application 120 6
Python guppy GSL 136 5
Python wagtail guppy subpackage heapy 174 6
Python guppy Introduction 215 6
Python wagtail Structural Block 258 6
Python wagtail Integrating into Django Project 370 6
Python wagtail testing 281 7
Python wagtail Basic Block 349 7
Python wagtail image tag 216 7
Python wagtail Templates 180 6
Python wagtail Backends 207 6
Python wagtail Indexing 190 6
Python wagtail Search 173 7
Python wagtail Snippets 192 6
Python wagtail Writing your own page models 165 9
Python wagtail model class PageRevision 196 10
Python wagtail model class Site 199 9
Python wagtail wagtail core model 219 9
Python wagtail page models 189 10
Python wagtail 166 11

Comments