Index structure question

Can I have a index with different field name for each document?

for example

document1
{
name:
empid:
location:
pay:
}

Document2
{
fullname:
address:
city:
zip
}

will it cause any problem in long run?

there is a need for it and use case. each record is not related to other record at all.
but on vizulization level I am using name on one visulization and fullname on second.

I have tested it and it works.

but I do not know if this kind of structure will cause any problem or not

You are better off having separate indices I think, they are different structures after all.

How many DIFFERENT types of docs & field name lists? As noted, separate indexes are traditional way unless quite limited in count and must be linked for some reason. If you have hundreds or thousands of types, there may be no good way at all - you certainly don't want indexes with > 100 fields if you can avoid it, and a few hundred is huge and not scale well. But also hundreds of indexes aren't great.

Other way is just index the main common fields and have a JSON blob that's not indexed in there with lots of different structures; you can't search it, but it would store, so all depends on your use case.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.