Beispiel #1
0
        /// <inheritdoc />
        /// <summary>
        /// Iterator for synonym (perfom an api call)
        /// </summary>
        /// <returns></returns>
        public IEnumerator <Synonym> GetEnumerator()
        {
            do
            {
                SearchResponse <Synonym> result = _index.SearchSynonyms(_query, _requestOptions);
                _hits = result.Hits.Count;
                _query.Page++;

                if (_hits == 0)
                {
                    _query.Page = 0;
                    yield break;
                }

                foreach (var hit in result.Hits)
                {
                    yield return(hit);
                }
            } while (_hits > 0);
        }