Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions sdk/search/azure-search-documents/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ and uplifted the properties to `SearchIndexerDataSourceConnection` and `SearchRe
`NGramTokenFilter`, and `PathHierarchyTokenizer`.
- Renamed `Similarity` to `SimilarityAlgorithm`.
- Renamed `Suggester` to `SearchSuggester`.
- Renamed fields `synonymMaps` to `synonymMapNames`, `analyzer` to `analyzerName`,
`searchAnalyzer` to `searchAnalyzerName` and `indexAnalyzer` to `indexAnalyzerName`
in `SearchField`, `SearchableField`.
- Renamed `SimpleField` to `SimpleFieldBuilder`, `SearchableField` to `SearchableFieldBuilder`
and `ComplexField` to `ComplexFieldBuilder`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you were specific on the listDataSourceConnection in the previous CHANGELOG, you should probably fix that one up as well.


## 1.0.0-beta.3 (2020-05-05)
- Replaced `isRetrievable` API with `isHidden`, parameter name changed from `retrievable` to `hidden`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,28 +47,28 @@ public static SearchField map(com.azure.search.documents.indexes.implementation.

if (obj.getAnalyzer() != null) {
LexicalAnalyzerName analyzer = LexicalAnalyzerNameConverter.map(obj.getAnalyzer());
searchField.setAnalyzer(analyzer);
searchField.setAnalyzerName(analyzer);
}

if (obj.getSearchAnalyzer() != null) {
LexicalAnalyzerName searchAnalyzer = LexicalAnalyzerNameConverter.map(obj.getSearchAnalyzer());
searchField.setSearchAnalyzer(searchAnalyzer);
searchField.setSearchAnalyzerName(searchAnalyzer);
}

String name = obj.getName();
searchField.setName(name);

if (obj.getIndexAnalyzer() != null) {
LexicalAnalyzerName indexAnalyzer = LexicalAnalyzerNameConverter.map(obj.getIndexAnalyzer());
searchField.setIndexAnalyzer(indexAnalyzer);
searchField.setIndexAnalyzerName(indexAnalyzer);
}

Boolean facetable = obj.isFacetable();
searchField.setFacetable(facetable);

if (obj.getSynonymMaps() != null) {
List<String> synonymMaps = new ArrayList<>(obj.getSynonymMaps());
searchField.setSynonymMaps(synonymMaps);
searchField.setSynonymMapNames(synonymMaps);
}

if (obj.getFields() != null) {
Expand Down Expand Up @@ -110,32 +110,32 @@ public static com.azure.search.documents.indexes.implementation.models.SearchFie
Boolean searchable = obj.isSearchable();
searchField.setSearchable(searchable);

if (obj.getAnalyzer() != null) {
if (obj.getAnalyzerName() != null) {
com.azure.search.documents.indexes.implementation.models.LexicalAnalyzerName analyzer =
LexicalAnalyzerNameConverter.map(obj.getAnalyzer());
LexicalAnalyzerNameConverter.map(obj.getAnalyzerName());
searchField.setAnalyzer(analyzer);
}

if (obj.getSearchAnalyzer() != null) {
if (obj.getSearchAnalyzerName() != null) {
com.azure.search.documents.indexes.implementation.models.LexicalAnalyzerName searchAnalyzer =
LexicalAnalyzerNameConverter.map(obj.getSearchAnalyzer());
LexicalAnalyzerNameConverter.map(obj.getSearchAnalyzerName());
searchField.setSearchAnalyzer(searchAnalyzer);
}

String name = obj.getName();
searchField.setName(name);

if (obj.getIndexAnalyzer() != null) {
if (obj.getIndexAnalyzerName() != null) {
com.azure.search.documents.indexes.implementation.models.LexicalAnalyzerName indexAnalyzer =
LexicalAnalyzerNameConverter.map(obj.getIndexAnalyzer());
LexicalAnalyzerNameConverter.map(obj.getIndexAnalyzerName());
searchField.setIndexAnalyzer(indexAnalyzer);
}

Boolean facetable = obj.isFacetable();
searchField.setFacetable(facetable);

if (obj.getSynonymMaps() != null) {
List<String> synonymMaps = new ArrayList<>(obj.getSynonymMaps());
if (obj.getSynonymMapNames() != null) {
List<String> synonymMaps = new ArrayList<>(obj.getSynonymMapNames());
searchField.setSynonymMaps(synonymMaps);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,20 +200,21 @@ private static SearchField enrichWithAnnotation(SearchField searchField, java.la
"Please specify either analyzer or both searchAnalyzer and indexAnalyzer."));
}
if (!searchableFieldPropertyAnnotation.analyzer().isEmpty()) {
searchField.setAnalyzer(LexicalAnalyzerName.fromString((searchableFieldPropertyAnnotation.analyzer())));
searchField.setAnalyzerName(LexicalAnalyzerName.fromString(
searchableFieldPropertyAnnotation.analyzer()));
}
if (!searchableFieldPropertyAnnotation.searchAnalyzer().isEmpty()) {
searchField.setAnalyzer(LexicalAnalyzerName.fromString(
(searchableFieldPropertyAnnotation.searchAnalyzer())));
searchField.setAnalyzerName(LexicalAnalyzerName.fromString(
searchableFieldPropertyAnnotation.searchAnalyzer()));
}
if (!searchableFieldPropertyAnnotation.indexAnalyzer().isEmpty()) {
searchField.setAnalyzer(LexicalAnalyzerName.fromString(
(searchableFieldPropertyAnnotation.indexAnalyzer())));
searchField.setAnalyzerName(LexicalAnalyzerName.fromString(
searchableFieldPropertyAnnotation.indexAnalyzer()));
}
if (searchableFieldPropertyAnnotation.synonymMaps().length != 0) {
List<String> synonymMaps = Arrays.stream(searchableFieldPropertyAnnotation.synonymMaps())
.filter(synonym -> !synonym.trim().isEmpty()).collect(Collectors.toList());
searchField.setSynonymMaps(synonymMaps);
searchField.setSynonymMapNames(synonymMaps);
}
}
return searchField;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ public PagedFlux<SearchIndexerDataSourceConnection> listDataSourceConnections()
* help with debugging.
* @return a list of DataSources
*/
public PagedFlux<SearchIndexerDataSourceConnection> listDataSourceConnection(RequestOptions requestOptions) {
public PagedFlux<SearchIndexerDataSourceConnection> listDataSourceConnections(RequestOptions requestOptions) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@heaths Address the comments here.

try {
return new PagedFlux<>(() ->
withContext(context -> this.listDataSourceConnectionsWithResponse(null, requestOptions, context))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@
* A helper Field model to build a complex field which uses {@code SearchFieldDataType.EDM_COMPLEX_TYPE} or
* collection of {@code SearchFieldDataType.EDM_COMPLEX_TYPE}.
*/
public class ComplexField extends SearchFieldBase {
public class ComplexFieldBuilder extends SearchFieldBase {
private List<SearchField> fields;

/**
* Initializes a new instance of the {@link ComplexField} class.
* Initializes a new instance of the {@link ComplexFieldBuilder} class.
*
* @param name The name of the field, which must be unique within the index or parent field.
* @param collection Whether the field is a collection of strings.
*/
public ComplexField(String name, boolean collection) {
public ComplexFieldBuilder(String name, boolean collection) {
super(name, collection ? SearchFieldDataType.collection(SearchFieldDataType.COMPLEX)
: SearchFieldDataType.COMPLEX);
}

/**
* Gets a collection of {@link SimpleField} or {@link ComplexField} child fields.
* Gets a collection of {@link SimpleFieldBuilder} or {@link ComplexFieldBuilder} child fields.
*
* @return The list of sub-fields.
*/
Expand All @@ -33,12 +33,12 @@ public List<SearchField> getFields() {
}

/**
* Sets a collection of {@link SimpleField} or {@link ComplexField} child fields.
* Sets a collection of {@link SimpleFieldBuilder} or {@link ComplexFieldBuilder} child fields.
*
* @param fields The list of sub-fields.
* @return The {@link ComplexField} object itself.
* @return The {@link ComplexFieldBuilder} object itself.
*/
public ComplexField setFields(List<SearchField> fields) {
public ComplexFieldBuilder setFields(List<SearchField> fields) {
this.fields = fields;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public final class SearchField {
* 'Simple', 'Stop', 'Whitespace'
*/
@JsonProperty(value = "analyzer")
private LexicalAnalyzerName analyzer;
private LexicalAnalyzerName analyzerName;

/*
* The name of the analyzer used at search time for the field. This option
Expand Down Expand Up @@ -157,7 +157,7 @@ public final class SearchField {
* 'Simple', 'Stop', 'Whitespace'
*/
@JsonProperty(value = "searchAnalyzer")
private LexicalAnalyzerName searchAnalyzer;
private LexicalAnalyzerName searchAnalyzerName;

/*
* The name of the analyzer used at indexing time for the field. This
Expand Down Expand Up @@ -189,7 +189,7 @@ public final class SearchField {
* 'Whitespace'
*/
@JsonProperty(value = "indexAnalyzer")
private LexicalAnalyzerName indexAnalyzer;
private LexicalAnalyzerName indexAnalyzerName;

/*
* A list of the names of synonym maps to associate with this field. This
Expand All @@ -200,7 +200,7 @@ public final class SearchField {
* existing fields. Must be null or an empty collection for complex fields.
*/
@JsonProperty(value = "synonymMaps")
private List<String> synonymMaps;
private List<String> synonymMapNames;

/*
* A list of sub-fields if this is a field of type Edm.ComplexType or
Expand Down Expand Up @@ -479,10 +479,10 @@ public SearchField setFacetable(Boolean facetable) {
* 'StandardAsciiFoldingLucene', 'Keyword', 'Pattern', 'Simple', 'Stop',
* 'Whitespace'.
*
* @return the analyzer value.
* @return the analyzer name.
*/
public LexicalAnalyzerName getAnalyzer() {
return this.analyzer;
public LexicalAnalyzerName getAnalyzerName() {
return this.analyzerName;
}

/**
Expand Down Expand Up @@ -512,11 +512,11 @@ public LexicalAnalyzerName getAnalyzer() {
* 'StandardAsciiFoldingLucene', 'Keyword', 'Pattern', 'Simple', 'Stop',
* 'Whitespace'.
*
* @param analyzer the analyzer value to set.
* @param analyzerName the analyzer name to set.
* @return the SearchField object itself.
*/
public SearchField setAnalyzer(LexicalAnalyzerName analyzer) {
this.analyzer = analyzer;
public SearchField setAnalyzerName(LexicalAnalyzerName analyzerName) {
this.analyzerName = analyzerName;
return this;
}

Expand Down Expand Up @@ -549,10 +549,10 @@ public SearchField setAnalyzer(LexicalAnalyzerName analyzer) {
* 'StandardLucene', 'StandardAsciiFoldingLucene', 'Keyword', 'Pattern',
* 'Simple', 'Stop', 'Whitespace'.
*
* @return the searchAnalyzer value.
* @return the searchAnalyzer name.
*/
public LexicalAnalyzerName getSearchAnalyzer() {
return this.searchAnalyzer;
public LexicalAnalyzerName getSearchAnalyzerName() {
return this.searchAnalyzerName;
}

/**
Expand Down Expand Up @@ -584,11 +584,11 @@ public LexicalAnalyzerName getSearchAnalyzer() {
* 'StandardLucene', 'StandardAsciiFoldingLucene', 'Keyword', 'Pattern',
* 'Simple', 'Stop', 'Whitespace'.
*
* @param searchAnalyzer the searchAnalyzer value to set.
* @param searchAnalyzerName the searchAnalyzer name to set.
* @return the SearchField object itself.
*/
public SearchField setSearchAnalyzer(LexicalAnalyzerName searchAnalyzer) {
this.searchAnalyzer = searchAnalyzer;
public SearchField setSearchAnalyzerName(LexicalAnalyzerName searchAnalyzerName) {
this.searchAnalyzerName = searchAnalyzerName;
return this;
}

Expand Down Expand Up @@ -621,10 +621,10 @@ public SearchField setSearchAnalyzer(LexicalAnalyzerName searchAnalyzer) {
* 'StandardLucene', 'StandardAsciiFoldingLucene', 'Keyword', 'Pattern',
* 'Simple', 'Stop', 'Whitespace'.
*
* @return the indexAnalyzer value.
* @return the indexAnalyzer name.
*/
public LexicalAnalyzerName getIndexAnalyzer() {
return this.indexAnalyzer;
public LexicalAnalyzerName getIndexAnalyzerName() {
return this.indexAnalyzerName;
}

/**
Expand Down Expand Up @@ -656,11 +656,11 @@ public LexicalAnalyzerName getIndexAnalyzer() {
* 'StandardLucene', 'StandardAsciiFoldingLucene', 'Keyword', 'Pattern',
* 'Simple', 'Stop', 'Whitespace'.
*
* @param indexAnalyzer the indexAnalyzer value to set.
* @param indexAnalyzerName the indexAnalyzer name to set.
* @return the SearchField object itself.
*/
public SearchField setIndexAnalyzer(LexicalAnalyzerName indexAnalyzer) {
this.indexAnalyzer = indexAnalyzer;
public SearchField setIndexAnalyzerName(LexicalAnalyzerName indexAnalyzerName) {
this.indexAnalyzerName = indexAnalyzerName;
return this;
}

Expand All @@ -673,10 +673,10 @@ public SearchField setIndexAnalyzer(LexicalAnalyzerName indexAnalyzer) {
* attribute can be changed on existing fields. Must be null or an empty
* collection for complex fields.
*
* @return the synonymMaps value.
* @return the synonymMap names.
*/
public List<String> getSynonymMaps() {
return this.synonymMaps;
public List<String> getSynonymMapNames() {
return this.synonymMapNames;
}

/**
Expand All @@ -688,11 +688,11 @@ public List<String> getSynonymMaps() {
* attribute can be changed on existing fields. Must be null or an empty
* collection for complex fields.
*
* @param synonymMaps the synonymMaps value to set.
* @param synonymMapNames the synonymMap names to set.
* @return the SearchField object itself.
*/
public SearchField setSynonymMaps(List<String> synonymMaps) {
this.synonymMaps = synonymMaps;
public SearchField setSynonymMapNames(List<String> synonymMapNames) {
this.synonymMapNames = synonymMapNames;
return this;
}

Expand Down
Loading