I am trying to run functions from an elasticsearch instance through to datatables to display results.
I am only getting 10 to show and no matter the query I get the same 10 all the time. Currently there are 141,000 results in elasticsearch but only able to read 10 in datatables.
<script src="//cdnjs.cloudflare.com/ajax/libs/datatables/1.10.8/js/jquery.dataTables.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/datatables/1.10.8/js/dataTables.bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/datatables/1.10.8/js/dataTables.jqueryui.min.js"></script>
<script src="//cdn.datatables.net/responsive/1.0.6/js/dataTables.responsive.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/datatables/1.10.8/js/dataTables.bootstrap.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/elasticsearch/10.0.1/elasticsearch.min.js"></script>
<script src="/javascript/jquery.elastic-datatables.js"></script>
<script>
var client = elasticsearch.Client({
host: 'localhost:9200'
});
$('#orders').dataTable({
'bProcessing': true,
'bServerSide': true,
'columns': [
{ 'sTitle': 'Order Code', 'sName': 'channel_order_code' },
{ 'sTitle': 'Created', 'sName': 'created_at' },
{ 'sTitle': 'Order ID', 'sName': 'po_number' },
{ 'sTitle': 'Tracking', 'sName': 'tracking' },
{ 'sTitle': 'Name', 'sName': 'bill_to_name' },
{ 'sTitle': 'Phone', 'sName': 'customer_phone' },
{ 'sTitle': 'Email', 'sName': 'customer_email' },
{ 'sTitle': 'Group ID', 'sName': 'group_id' },
{ 'sTitle': 'Order Status', 'sName': 'status' },
{ 'sTitle': 'Upload Status', 'sName': 'upload_status' },
{ 'sTitle': 'Subtotal', 'sName': 'subtotal_amount' },
{ 'sTitle': 'Shipping', 'sName': 'channel' },
{ 'sTitle': 'State', 'sName': 'state' }
],
'fnServerData': $.fn.dataTable.elastic_datatables( {
index: 'orders',
type:'logs',
client,
body: {
query: {
match_all: {
}
}
}
} )
</script>
When I go to the url and enter /orders/_search?q=* I get the full results, however, through this I get 10. When I put in _search or search in the 'type' I get nothing, when I remove 'type' I get the same 10.
Any help is appreciated.
This is the package using for jquery.elastic-datatables.js https://github.com/pidupuis/elastic-datatables