Skip to content
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

Circular Reference in JSON Serialization of Nest.DSL.Search.SearchSourceDescriptor<T> #706

Closed
nariman-haghighi opened this issue Jun 9, 2014 · 1 comment

Comments

@nariman-haghighi
Copy link

Here's the query:

  public IEnumerable<string> GetDocumentIds(Guid userId)
  {
      var queryResults = new ElasticClient(SearchSettings).Search<Media>(x => x
              .Index("Media")
              .Source(s => s.Include(m => m.Id))
              .Size(5000)
              .Query(p => p.Term(f => f.UserId, userId.ToString())));

      return queryResults.Documents.Select(m => m.Id);
  }

Exception: Newtonsoft.Json.JsonSerializationException: Self referencing loop detected for property 'self' with type 'Nest.DSL.Search.SearchSourceDescriptor`1[Data.Model.Media]'. Path '_source'.

The offending property seems to be in: NEST.ISearchRequest.Source

@Mpdreamz
Copy link
Member

Thank you for catching this one @nariman-haghighi 👍

The .Source() code path only had integration tests and no unit tests. Unit tests are run as part of the continuous builds but integration tests are not.

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