RT and Plain Indexes

In the documentation it says that you cannot mix RT with Plain indexes which is why I’m getting the error: FATAL: 'data_dir' cannot be mixed with index declarations in '/etc/manticoresearch/manticore.conf'

Where do I create the plain index(es) for my CSV file(s) so that I can eventually attach them to my RT index? When I put the source and index declarations in the same manticore.conf file, I get the error above. Do I need to literally duplicate the manticore file and set different values for data_dir, logs, ports, etc… in searchd and have a different config for the plain index(es)?

you can not create or use plain index in Real-time mode. However you could follow the description to get your data.

To use your already build plain index in Real-time mode you have

  • create plain in RT index in plain mode at config (plain.conf)
  • start daemon with config (plain.conf) in plain mode
  • issue ATTACH statement to attach plain index into RT index
  • shutdown daemon
  • start daemon with real-time mode
  • issue IMPORT statement to import your RT index from some directory

This way you will get your plain index into Real-time mode.

Is there a way to do this without having to shutdown the daemon? Maybe running on separate servers or possibly running the plain-mode version in a docker instance?

you need 2 daemons

  • first with plain-mode config that attaches plain into RT
  • second with RT-mode config that imports RT index

you could try any sequence that you want

Just to try it out, I copied/pasted default manticore config file and added the source/index for my plain index. The docker instance shuts down with an exit 0. I have to remove the source/index from the config in order to get it to run properly. I understand that RT-Mode is the default, I don’t see any settings that allow you to switch from RT to Plain.

You’d better just maintain 2 configs:

  1. for indexation
    • just for building an index (you can have just source and index there)
    • if you also want to prepare an RT index from the plain index with help of ATTACH you also need searchd since you’ll have to run searchd for that
  2. just a normal config in RT mode (i.e. with data_dir)

It’s ok that docker exec ... indexer exits with 0.

Can I attach it from the RT index without having to add a searchd to the plain config? or does the attach have to happen from the plain config?

I tried to run the following:
mysql> attach index sample to rtindex parts; ERROR 1064 (42000): no such index 'sample' mysql>

The data exists. I have a directory in my data directory named “sample”, which is what I named it and it looks like it was indexed as expected.

import works only with rt index

rt-mode where import works does not work with plain indexes

I already posted links into manual with detailed explanation