lucilla icon indicating copy to clipboard operation
lucilla copied to clipboard

Add @Include as an option to @Ignore

Open austinhodak opened this issue 3 years ago • 1 comments

Some of my data classes are huge and adding @Ignore to every field I didn't want to search would be tedious, as there are only a few fields I'd like to search with, maybe an @Include would be good?

austinhodak avatar Jan 24 '22 16:01 austinhodak

I thought about @Ignore vs @Include/@Index too, but there was no real way to know which is better without community feedback.

Having both annotations leads to ambiguity in some cases.

No annotations: What happen with the tags property?

data class Document(
  @Id
  val id: Int,
  @Index
  val name: String,
  val tags: String,
  @Ignore
  val contents: String
)

Conflicting annotations: Do we index id and name?

data class Document(
  @Id
  @Ignore
  val id: Int,

  @Ignore
  @Index
  val name: String,
)

What is the acceptable behaviour for these situations in your opinion?

haroldadmin avatar Jan 25 '22 04:01 haroldadmin