Skip to content

Cannot reindex all types in 1.7.1 #1583

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

Closed
dashkan opened this issue Oct 6, 2015 · 2 comments
Closed

Cannot reindex all types in 1.7.1 #1583

dashkan opened this issue Oct 6, 2015 · 2 comments

Comments

@dashkan
Copy link

dashkan commented Oct 6, 2015

After upgrading to v1.7.1 reindex functionality is broken. When reindexing the type System.Object the system no longer reindexes all types. It actually tries to reindex type "object" as seen in this url http://localhost:9200/myindex/object/_search?search_type=scan&scroll=2m&pretty=true.

Looking at the version history for ReindexObservable.cs

In 1.6.x and < it did the following:

if (typeof(T).Name.Equals(typeof(object).Name))
{
    searchDescriptor = s => searchDescriptor(s).AllTypes();
}

SHA: d1f0f42

This check is no longer being done.

In 1.7.1 and dev branch it simply reads the allTypes internal property from ReindexDescriptor and calls AllTypes on searchDescriptor if true.

var allTypes = this._reindexDescriptor._allTypes;

.....

if (allTypes)
   searchDescriptor.AllTypes();
else
   searchDescriptor.Type<T>();

In fact, the internal type allTypes in ReindexDescriptor is never set and cannot be set by the client SDK.

Wouldn't it be cleaner if NEST supported a non-generic ReindexDescriptor to index all types?

Should AllTypes be exposed on the fluent API?

Think that at a minimum ReindexDesciptor should reindex all types for backward compatibility with 1.6.x and <.

Happy to submit a PR once confirmed a bug.

@Mpdreamz
Copy link
Member

Mpdreamz commented Oct 6, 2015

Thanks for this @ashkandaie we introduced a non generic Reindex() method on the client itself to cover this use case. The special behaviour of <object> was treated as a bug.

See also: #1433

Sorry this bit you ;(

@Mpdreamz Mpdreamz closed this as completed Oct 6, 2015
@dashkan
Copy link
Author

dashkan commented Oct 6, 2015

Perfect!!

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants