|
|
Posted on 12/20/2018 5:32:53 PM
|
|
|
|

ElasticSearch:
ES is a near-real-time search platform based on Lucene, which provides a distributed full-text search engine that uses RESTful as an API interface to index and query indexes and data through simple Get, Post and other operations.
Essential Knowledge:
Installation:
NEST can be installed using nuget with the following command:
.NET version requires at least 4.6, which is detailed as follows:The hyperlink login is visible.
Hi, we did drop .NET 4.5 support for .netstandard1.3, net46 is the new baseline.
We did this so that we could start introducing netcoreapp2.1 TFM and focus on bringing all the performance work to the client.
Can you tell us about your environment?
.NET 4.5 started in 2012 and by 2014 only 4.5.2 was supported by Microsoft. At some point, we need to make the difficult decision to abandon 4.5.2 so that we can focus more on the current and newer .NET versions. Just like we gave up a few years ago. NET 3.5, this is not an easy task.
Create an index:
If the index does not exist, use the following method to create a mapping at the same time as the index is created
Send a put request to the interface, and the json data is as follows:
Back:
{ "acknowledged": true, "shards_acknowledged": true, "index": "test1"
} As shown below:
Add documentation:
In fact, it is to add data, which is equivalent to the rows of the database, I collected some 163 news and successfully added a total of 45 articles, as shown in the figure below:
Look at the added data via the elasticsearch-head plugin.
Manually add a piece of data with html code, put the content as follows:
We insert a piece of data with HTML tags to test the highlighting function, whether to escape the original html and js code, otherwise it will cause xss attacks, etc.
Search:
Search for keywords such as "man" and "test" through the software, and the correct search results will appear, and the request content of the post will be displayed, which is convenient for us to debug, as follows:
Search for test keywords and find that the html code contained in the record has been successfully escaped!
The source code contains the news txt file, Winform calls elasticsearch source code to download:
Tourists, if you want to see the hidden content of this post, please Reply
|
Previous:When I first came to the ramp, I shared the fashion design tutorial with everyoneNext:CodeIgniter, a simple and fast PHP MVC framework
|