{ "brand" : 1, "color" : 1, "han" : 1, "name" : 1, "size" : 1}
// select a database$db = $m->computerdb;
// select a collection $collection = $db->products;
$result = $collection->find(array('$text' => array('$search' => 'Asus')), array('pictures' => 0))->limit(1);
// iterate through the resultsforeach ($result as $document) { echo $document["name"] . "\n";}
2016-09-25T15:16:15.008-0400 F - [conn7] out of memory.
2016-09-25T15:26:26.404-0400 E STORAGE [conn3] WiredTiger (12) [1474831586:358439][1069:0x7f7395f5c700], file:collection-2-161678893487581897.wt, WT_CURSOR.search: memory allocation of 7098127 bytes failed: Cannot allocate memory2016-09-25T15:26:26.540-0400 I - [conn3] Invariant failure: seekRet resulted in status UnknownError: 12: Cannot allocate memory at src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp 527
Hi,
I created a text index like this:
{ "brand" : 1, "color" : 1, "han" : 1, "name" : 1, "size" : 1 }
Is this the syntax you used to create the index? This looks like a regular compound index instead of a text index. Could you post the output of db.products.getIndexes()
(assuming your collections is named products
)?
2016-09-25T15:16:15.008-0400 F - [conn7] out of memory.
From the error, it looks like MongoDB is running out of memory while executing the query. However, you mentioned that you added more memory to the server, but the error persists.
Could you post more information:
db.product.getIndexes()
Best regards,
Kevin