How to use -txindex to enable blockchain transaction queries? I am trying getting the raw of transaction. But I am getting the following error with following command and  RPC call as well.


  bitcoin-cli getrawtransaction ad844933ceb9cf990fd75ebd2f6731527885e31d1a4c9ea292db235bcd64bdbe


Error 
No such mempool transaction. Use -txindex to enable blockchain transaction queries. Use gettransaction for wallet transactions.
use 

txindex = 1


in you bitcoin.conf file and restart daemon with -reindex flag if you are building it for the first time, it might take a while but after txindex is defined you can get data for any transaction in blockchain no matter if its related to your wallet or not.  

Alternetivly you can start your daemon with 

 bitcoind -daemon -txindex=1 -reindex=1


Either way it functions the same