Skip to content

Commit

Permalink
Merge branch 'release/3.0' into release/4.0
Browse files Browse the repository at this point in the history
# Conflicts:
#	docs/searching.md
  • Loading branch information
Shazwazza committed Oct 27, 2023
2 parents fc532d3 + ee9ce0b commit c6fad68
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 14 deletions.
8 changes: 4 additions & 4 deletions docs/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,18 @@ GEM
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.3.6)
mini_portile2 (2.8.0)
mini_portile2 (2.8.4)
minima (2.5.1)
jekyll (>= 3.5, < 5.0)
jekyll-feed (~> 0.9)
jekyll-seo-tag (~> 2.1)
nokogiri (1.13.9)
mini_portile2 (~> 2.8.0)
nokogiri (1.15.4)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (4.0.7)
racc (1.6.0)
racc (1.7.1)
rb-fsevent (0.10.4)
rb-inotify (0.10.1)
ffi (~> 1.0)
Expand Down
4 changes: 2 additions & 2 deletions docs/indexing.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ order: 0

Indexing
===
_**Tip**: There are many examples of indexing in the [`LuceneIndexTests` source code](https://github.com/Shazwazza/Examine/blob/dev/src/Examine.Test/Index/LuceneIndexTests.cs) to use as examples/reference._
_**Tip**: There are many examples of indexing in the [`LuceneIndexTests` source code](https://github.com/Shazwazza/Examine/blob/dev/src/Examine.Test/Examine.Lucene/Index/LuceneIndexTests.cs) to use as examples/reference._

Examine will index any data you give it within a `ValueSet`. You can index one or multiple items at once and there's a few different ways to do that. Each field in a `ValueSet` can also contain one or more values.

Expand Down Expand Up @@ -312,4 +312,4 @@ private void IndexCommited(object sender, EventArgs e)

</section>
</div>
</div>
</div>
33 changes: 26 additions & 7 deletions docs/searching.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ order: 2
Searching
===

_**Tip**: There are many examples of searching in the [`FluentApiTests` source code](https://github.com/Shazwazza/Examine/blob/master/src/Examine.Test/Search/FluentApiTests.cs) to use as examples/reference._
_**Tip**: There are many examples of searching in the [`FluentApiTests` source code](https://github.com/Shazwazza/Examine/blob/dev/src/Examine.Test/Examine.Lucene/Search/FluentApiTests.cs) to use as examples/reference._

## All fields (managed queries)

Expand All @@ -33,8 +33,8 @@ be searched. In most cases the field value type will be 'Full Text', others may
```csharp
var searcher = myIndex.Searcher; // Get a searcher
var results = searcher.CreateQuery() // Create a query
.Field("Address", "Hills") // Look for any "Hills" addresses
.Execute(); // Execute the search
.Field("Address", "Hills") // Look for any "Hills" addresses
.Execute(); // Execute the search
```

### Terms and Phrases
Expand Down Expand Up @@ -125,7 +125,7 @@ query.Field("nodeTypeAlias", "CWS_Home".Boost(20));
var results = query.Execute();
```

This will boost the term `CWS_Home` and make enteries with `nodeTypeAlias:CWS_Home` score higher in the results.
This will boost the term `CWS_Home` and make entries with `nodeTypeAlias:CWS_Home` score higher in the results.

## Proximity

Expand All @@ -141,7 +141,6 @@ var query = searcher.CreateQuery("content");
query.Field("metaKeywords", "Warren creative".Proximity(5));
var results = query.Execute();
```

## Fuzzy

Fuzzy searching is the practice of finding spellings that are similar to each other. Examine searches based on the [Damerau-Levenshtein Distance](https://en.wikipedia.org/wiki/Damerau%E2%80%93Levenshtein_distance). The parameter given in the `.Fuzzy()` method is the edit distance allowed by default this value is `0.5` if not specified.
Expand Down Expand Up @@ -195,13 +194,11 @@ var query = searcher.CreateQuery()
```

This will match for example: `test`, `tests` , `tester`, `testers`

### Lucene native query (Multiple characters)

The multiple wildcard character is `*`. It will match 0 or more characters.

Example

```csharp
var query = searcher.CreateQuery()
.NativeQuery("equipment:t*pad");
Expand Down Expand Up @@ -451,3 +448,25 @@ var createdFacetResults = results.GetFacet("Created"); // Returns the facets for

var firstRangeValue = createdFacetResults.Facet("first"); // Gets the IFacetValue for the facet "first"
```

### Lucene Searches

Sometimes you need access to the underlying Lucene.NET APIs to perform a manual Lucene search.

An example of Spatial Search with the Lucene APIs is in the [Examine source code](https://github.com/Shazwazza/Examine/blob/dev/src/Examine.Test/Examine.Lucene/Extensions/SpatialSearch.cs).

```csharp
var searcher = (LuceneSearcher)indexer.Searcher;
var searchContext = searcher.GetSearchContext();

using (ISearcherReference searchRef = searchContext.GetSearcher())
{
// Access the instance of the underlying Lucene
// IndexSearcher instance.
var indexSearcher = searchRef.IndexSearcher;

// You can then call indexSearcher.Search(...)
// which is a Lucene API, customize the parameters
// accordingly and handle the Lucene response.
}
```
2 changes: 1 addition & 1 deletion docs/v2/docfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
]
}
],
"dest": "_site/v2",
"dest": "_site",
"globalMetadataFiles": [],
"fileMetadataFiles": [],
"template": [
Expand Down

0 comments on commit c6fad68

Please sign in to comment.