Closed scott-alvis closed 3 years ago
Thanks @scott-alvis. I will check and update the code for the July release. The code merge should be completed this week.
@scott-alvis I have checked your code and suggestion. Here is what I have found:
createIndex
method of the SearchIndexClient
class. The method call could be found here. SearchIndex
object as the parameter. This object is defined here. SearchIndex
object has the fields
property of type SearchField
array. This SearchField
object is defined hereSearchField
object has SimpleField
object which is defined here as:
export interface SimpleField {
name: string;
type: SearchFieldDataType;
key?: boolean;
hidden?: boolean;
searchable?: boolean;
filterable?: boolean;
sortable?: boolean;
facetable?: boolean;
analyzerName?: LexicalAnalyzerName;
...........
...........
As you can see, the SimpleField
has the property analyzerName
and not analyzer
. So, In your example (mentioned in the issue description), you should have set the property as analyzerName
and it would have worked correctly.
Please let me know if you still face any more issues. Thanks
Then may I suggested updating the quick start below as it suggests using an index-definition.json file which uses analyzer
which is not preserved when the index is created.
https://docs.microsoft.com/en-us/azure/search/search-get-started-javascript
@scott-alvis Thanks for pointing this documentation. I am working with the docs team and will fix the documentation soon
I am still coordinating with Derek to update the docs. Otherwise, no work is pending on this issue. I will track the docs upgrade and close this issue. Until closing, I am moving this issue to August release.
The documentation has been updated. Closing this issue
Describe the bug I altered the example below adding
analyzer: "en.microsoft"
to the description field of the index object. When I viewed the index in the portal the analyzer was not set on description field.Example Code https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/search/search-documents/samples/javascript/src/indexes/createIndex.js
To Reproduce Steps to reproduce the behavior:
analyzer: "en.microsoft"
the the example code above. Either review the results of the api call or view the index in the portal.Expected behavior Analyzer property should be set.
Screenshots
Changes to the example code:
Index being sent to the api:
Results from the api call (analyzer is set to null):
Additional context I've also used the same index and posted it via postman and analyzer is properly set.
After some additional debugging I believe the function below is the culprit.
The field object does not have an 'analyzerName' property.
I believe the code should be:
Additional Notes If you change the property name to
analyzerName: "en.microsoft"
it works as expected but every where in the documentation the field is calledanalyzer
.The
analyzer
property works as expected on properties inside a Collection(Edm.ComplexType).