-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RavenDB 6.1 breaking changes #1890
Conversation
To reviewers:
Besides these: thanks (o: |
…rver configuration options page
1. Open the index definition's **Fields** tab. | ||
2. Click **Add Field** to specify what field Corax shouldn't index. | ||
3. Enter the name of the field Corax should not index. | ||
4. Set to **Yes** when Corax is used since Corax will not index the value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's mention that storing the field will make that when querying and using this field in projection then it will be retrieved directly from the index. I know we have it mentioned in different part of the docs but this is important so let's repeat it again here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-->
{NOTE: }
Content we retrieve from the database and store in indexes becomes available for projection and will be henceforth retrieved directly from the indexes, accelerating its retrieval at the expense of indexes storage space.
{NOTE/}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perfect
|
||
--- | ||
|
||
#### 3. Disable the Indexing of the Complex Field |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to rephrase this section. Saying that you can disable the indexing on a specific field isn't the "solution". The whole point is that a user needs to revise the index definition and the usage of fields that they intended for indexing.
Can we emphasize the need of revising the definition? I'd like to force a users make him/her more aware of what they are doing. I'm afraid that just saying "disable the indexing on that field and store it" might sound like a solution. While maybe they don't event need that field at all.
So maybe we can say (similar to what you have here but from slightly different angle):
- searching over a complex field isn't typically indented, so it's likely you don't actually need that field at all
- although if you needed this complex field because of projecting it during queries then you might still keep it but then disable the indexing and explicitly mark that it's stored
@reebhub if you have any doubts please ping me directly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
->
3. Revise index definition and fields usage
As shown above, indexing a whole complex field is rarely needed, and users would typically index and search only the simple properties such a field contains.
Queries may sometimes need, however, to project the content of an entire complex field.
When this is the case, you can revise the index definition (see below) to disable the indexing of the complex field but store its content so projection queries would be able to project it.
4. Set to **Yes** when Corax is used since Corax will not index the value. | ||
5. Select **No** to disable indexing for the specified field. | ||
|
||
* To disable indexing for a specified field **using Code**: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please note that this sample code does 2 things, marks the field as non indexed and marks it for storing inside index
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-->
-
To store a field's content and disable its indexing via Studio:
- Open the index definition's Fields tab.
- Click Add Field to specify what field Corax shouldn't index.
- Enter the name of the field Corax should not index.
- Select Yes to Store the field's content
- Select No to disable the field's indexing
-
To store a field's content and disable its indexing using Code:
{CODE:csharp index-definition_disable-indexing-for-specified-field@Indexes/SearchEngines.cs /}
|
||
#### 4. Turn the complex property into a string | ||
|
||
You can handle the complex property as a string. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's underline that this is an option only if you really need to index it as a JSON, and search over it. Note it will keep JSON structure so all { }
and propetry names like { "Latitude":... , "Longitude": ... }
will be processed as well (by the specified analyzer etc)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see we talk about that below. So it's fine. Maybe just underline that this is last resort option, if you really need that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah the warning is kind of sharp as it is. added "as a last resort" in any case.
-->
{NOTE: }
Serializing all the properties of a complex property into a single string, including names, values, brackets, and so on, can be used as a last resort to produce a string that doesn't make a good feed for analyzers and is not commonly used for searches.
It does, however, make sense in some cases to project such a string.
{NOTE/}
* If a **static index** is used and it doesn't explicitly relate | ||
to the complex field, Corax will automatically exempt the field | ||
from indexing (by defining **Indexing: No** for this field as shown | ||
[above](../../indexes/search-engine/corax#disable-the-indexing-of-the-complex-field)). | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not longer the case. We no longer have any distinction between setting explicitly Indexing: Yes, and having the default (which is also Indexing: Yes).
The behavior is the same now. We simply relay on Indexing.Corax.Static.ComplexFieldIndexingBehavior
option. I think it's worth mentioning here that this is only for new deployed indexes to version 6.1 (or if they will be reset on 6.1, since it's effectively the same as deploying a new index). Old indexes will keep the old behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed it to a description of the three scenarios -
- auto index (same description as before)
- old static index (same description as before)
- new static index (behavior set by
ComplexFieldIndexingBehavior
)
Corax will throw a `NotSupportedInCoraxException ` exception with this message: | ||
**The value of `{fieldName}` is a complex object. Indexing it | ||
as a text isn't supported. You should consider querying on individual | ||
fields of that object.** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The message will be different:
The value of '{fieldName}' field is a complex object. Typically a complex field is not intended to be indexed as as whole hence indexing it as a text isn't supported in Corax. The field is supposed to have 'Indexing' option set to 'No' (note that you can still store it and use it in projections).
Alternatively you can switch 'Indexing.Corax.Static.ComplexFieldIndexingBehavior' configuration option from 'Throw' to 'Skip' to disable the indexing of all complex fields in the index or globally for all indexes (index reset is required).
If you really need to use this field for searching purposes, you have to call ToString() on the field value in the index definition. Although it's recommended to index individual fields of this complex object. Read more at: https://ravendb.net/l/OB9XW4/6.1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
fields of that object.** | ||
|
||
* If `ComplexFieldIndexingBehavior` is set to **`Skip`** - | ||
Corax will skip the complex field without throwing an exception. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corax will skip the complex field without throwing an exception. | |
Corax will skip indexing the complex field without throwing an exception. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
.Where(x => x.Suitcase.Any(p => p.Size == "Small" && p.Color == "Silver")) | ||
.ToList(); | ||
} | ||
{CODE-BLOCK/} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can add more explanation here? Basically in order to handle a query like that we need a fanout index. That is no supported by auto indexes, hence the solution is to use a static fanout index.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we should mention this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added:
{INFO: }
While auto indexes do not currently support this type of query, static indexes do.
You can define a static fanout index that creates separate index entries for different document sub-objects, and run your query over these entries.
Read about the indexing of nested data here,
and find explanations and samples for fanout indexes here.
{INFO/}
|
||
--- | ||
|
||
{PANEL: Tracking operations using the Changes API now requires Node Tag} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is client side change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved to the client-breaking-changes page
{CODE-BLOCK:csharp} | ||
public enum CoraxComplexFieldIndexingBehavior | ||
{ | ||
None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather not mention None
option here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
{PANEL: MsSql connection string requires an Encrypt property} | ||
|
||
To establish a connection with an MsSql server via ETL, RavenDB is required | ||
by the `Microsoft.Data.SqlClient` package it utilizes to include in its |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could mention the reason of this change, e.g.
by the Microsoft.Data.SqlClient
package (that replaced deprecated System.Data.SqlClient
in version 6.0.105)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-->
To establish a connection with an MsSql server via ETL, RavenDB is required by the Microsoft.Data.SqlClient
package it utilizes (which replaces the deprecated System.Data.SqlClient
package we've been using in previous versions) to include..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
connection string an `Encrypt` property that would determine whether to | ||
encrypt the connection or not. | ||
|
||
Recent RavenDB versions added this property to their connection strings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It only applies to versions 6.0.105 up to 6.1.0 (excluded)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-->
Some RavenDB versions preceding 6.1
(down to 6.0.105
) added this..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just RavenDB versions preceding 6.1 (down to 6.0.105) added this...
will be better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
string and users are required to explicitly choose whether to encrypt the | ||
connection or not. | ||
|
||
To encrypt the connection include an `Encrypt=true` in your connection |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Encrypt
is an enum, so maybe we should just mention they should either set it to Strict
or Mandatory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or Optional
, right @Lwiel ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but not if they want to encrypt the connection. Optional
will make it unencrypted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, but this is up to user. We just say what are the options
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
.Where(x => x.Suitcase.Any(p => p.Size == "Small" && p.Color == "Silver")) | ||
.ToList(); | ||
} | ||
{CODE-BLOCK/} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we should mention this
from doc in docs.Orders | ||
select new { | ||
// This attempt to construct a collection name will fail with an exception | ||
ComapnyName = LoadDocument(doc.Company, doc.Company.Split('/')[0]).Name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CompanyName
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed, thx
|
||
* In this page: | ||
* [Tracking operations using the Changes API now requires Node Tag](../../migration/server/server-breaking-changes#tracking-operations-using-the-changes-api-now-requires-node-tag) | ||
* [MsSql connection string requires an Encrypt property](../../migration/server/server-breaking-changes#mssql-connection-string-requires-an-encrypt-property) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MSSQL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
||
{PANEL/} | ||
|
||
{PANEL: MsSql connection string requires an Encrypt property} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MSSQL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
An **identity parts separator** can now be defined using the server-wide client configuration, | ||
to replace the default separator with a user-defined one. | ||
|
||
The configuration option was available in Studio's **Client Configuration** for a while, but |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would phrase that differently. Because previously that value could be set in server-wide client configuration, but wasn't taken into account for Database IdentityPartsSeparator. This means that if user set that value prior to 6.1 it was not active, but migrating to 6.1 will immediately activate it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
When [CounterBatchOperation](../../client-api/operations/counters/counter-batch) is | ||
called to `Increment` a batch of counters, and `Delta` is not specified to indicate | ||
what value should be added to the counters, the operation will increment the counters | ||
by a default `Delta` of `1`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
write that it was 0 before and that 1 is consistent with rest of the API
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
The behavior of RavenDB's [Corax](../../indexes/search-engine/corax) search engine while | ||
handling [complex JSON objects](../../indexes/search-engine/corax#handling-of-complex-json-objects) | ||
in **static indexes** is now configurable using the `Indexing.Corax.Static.ComplexFieldIndexingBehavior` | ||
configuration option. | ||
(The [handling of auto indexes](../../indexes/search-engine/corax#if-corax-encounters-a-complex-property-while-indexing) | ||
remains unchanged.) | ||
|
||
By default, `ComplexFieldIndexingBehavior` is set to **`Throw`**, instructing the search | ||
engine to throw a `NotSupportedInCoraxException` exception when it encounters a complex | ||
field in a static index. | ||
The exception includes this message: **The value of '`{fieldName}`' field is a complex object. | ||
Indexing it as a text isn't supported. You should consider querying on individual fields of that object.** | ||
|
||
If you prefer, you can set `ComplexFieldIndexingBehavior` to **`Skip`** to disable the | ||
indexing of complex fields without throwing an exception or raising a notification. | ||
|
||
* The configuration option will apply only to **new** static indexes, created after the release | ||
of RavenDB 6.1. It will not affect older indexes. | ||
* `ComplexFieldIndexingBehavior` can be set for a particular index as well as for all indexes. | ||
* Though complex fields cannot be indexed, they **can** still be stored and projected. | ||
* To search by the contents of a static index's complex field, you can convert it | ||
to a string (using `ToString` on the field value in the index definition). | ||
It is recommended, though, to index individual properties of the complex field. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
cc @arekpalinski
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx
changed it a bit and added a few links to the revised Corax section
**disable indexing** for this field by defining **Indexing: No** for it as shown | ||
[above](../../indexes/search-engine/corax#disable-the-indexing-of-the-complex-field). | ||
* If the Indexing flag is set to anything but "no" - | ||
Corax will throw a `NotSupportedInCoraxException ` exception. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it will do it just once, since we also disable the indexing of that field. So it won't attempt to index next values from that field
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-->
- If the Indexing flag is set to anything but "no" -
Corax will throw aNotSupportedInCoraxException
exception.
As disabling indexing for this field will prevent additional attempts to index its values,
the exception will be thrown just once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great
Please check one, new comment from. Other than that it LGTM |
…es` page, fixed by review comments
|
||
* The _Value_ is saved only if the passed _index_ is equal to the _index_ currently stored in the server for the specified _Key_. | ||
|
||
* Creating a new compare exchange item is possible only when the passed _index_ is `0`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add the "non-zero index" in cpmxg creation and "Example III" also to the java and nodejs pages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will be able to do that only when a 6.1 client is available for these languages..
…erverOptions.Licensing.ThrowOnInvalidOrMissingLicense`
Related issues:
RDoc-2951 - Document breaking changes for 6.1
RDoc-2968 - Add 6.1 breaking changes to related 6.1 articles