{"id":123903,"date":"2024-06-25T15:19:41","date_gmt":"2024-06-25T12:19:41","guid":{"rendered":"https:\/\/www.javacodegeeks.com\/?p=123903"},"modified":"2024-06-25T15:19:44","modified_gmt":"2024-06-25T12:19:44","slug":"lucene-mmapdirectory-and-bytebuffersdirectory-examples","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/lucene-mmapdirectory-and-bytebuffersdirectory-example.html","title":{"rendered":"Lucene MMapDirectory and ByteBuffersDirectory Examples"},"content":{"rendered":"<p><a href=\"https:\/\/lucene.apache.org\/\" target=\"_blank\" rel=\"noopener\">Apache Lucene<\/a> is a powerful search library written in Java. It provides various directory implementations for storing index files, such as <code>ByteBuffersDirectory<\/code> and <code>MMapDirectory<\/code>. These directories differ in how they manage file I\/O operations. Let us delve into understanding MmapDirectory and ByteBuffersDirectory with the use of basic examples.<\/p>\n<h2><a name=\"maven-dependency\"><\/a>1. Maven Dependency<\/h2>\n<p>To use Lucene in your project, you need to add the necessary Maven dependencies to your <code>pom.xml<\/code> file. Below is the dependency you need for including Lucene Core, which includes the directory implementations we will be discussing.<\/p>\n<pre class=\"brush:xml; wrap-lines:false;\">&lt;dependency&gt;\n    &lt;groupId&gt;org.apache.lucene&lt;\/groupId&gt;\n    &lt;artifactId&gt;lucene-core&lt;\/artifactId&gt;\n    &lt;version&gt;jar_version&lt;\/version&gt;\n&lt;\/dependency&gt;\n&lt;dependency&gt;\n    &lt;groupId&gt;org.apache.lucene&lt;\/groupId&gt;\n    &lt;artifactId&gt;lucene-analyzers-common&lt;\/artifactId&gt;\n    &lt;version&gt;jar_version&lt;\/version&gt;\n&lt;\/dependency&gt;\n<\/pre>\n<h2><a name=\"lucene-bytebuffersdirectory-example\"><\/a>2. Lucene ByteBuffersDirectory Example<\/h2>\n<p>The <code>ByteBuffersDirectory<\/code> is a directory implementation that stores files in memory using Java&#8217;s <code>ByteBuffer<\/code>. This can be advantageous for scenarios requiring high-speed read\/write operations, as it eliminates the overhead associated with disk I\/O. Here is a simple example of how to use <code>ByteBuffersDirectory<\/code>:<\/p>\n<pre class=\"brush:java; wrap-lines:false;\">package com.jcg. example;\n\nimport org.apache.lucene.analysis.standard.StandardAnalyzer;\nimport org.apache.lucene.document.Document;\nimport org.apache.lucene.document.Field;\nimport org.apache.lucene.document.StringField;\nimport org.apache.lucene.document.TextField;\nimport org.apache.lucene.index.IndexWriter;\nimport org.apache.lucene.index.IndexWriterConfig;\nimport org.apache.lucene.search.IndexSearcher;\nimport org.apache.lucene.search.Query;\nimport org.apache.lucene.search.ScoreDoc;\nimport org.apache.lucene.search.TopDocs;\nimport org.apache.lucene.search.TermQuery;\nimport org.apache.lucene.store.ByteBuffersDirectory;\nimport org.apache.lucene.store.Directory;\n\npublic class ByteBuffersDirectoryExample {\n    public static void main(String[] args) throws Exception {\n        Directory directory = new ByteBuffersDirectory();\n        StandardAnalyzer analyzer = new StandardAnalyzer();\n        IndexWriterConfig config = new IndexWriterConfig(analyzer);\n        IndexWriter writer = new IndexWriter(directory, config);\n\n        Document doc = new Document();\n        doc.add(new StringField(\"title\", \"Lucene in Action\", Field.Store.YES));\n        doc.add(new TextField(\"content\", \"Lucene is a search library\", Field.Store.YES));\n        writer.addDocument(doc);\n\n        writer.close();\n\n        IndexSearcher searcher = new IndexSearcher(DirectoryReader.open(directory));\n        Query query = new TermQuery(new Term(\"content\", \"search\"));\n        TopDocs results = searcher.search(query, 10);\n        for (ScoreDoc sd : results.scoreDocs) {\n            Document foundDoc = searcher.doc(sd.doc);\n            System.out.println(\"Found: \" + foundDoc.get(\"title\"));\n        }\n        directory.close();\n    }\n}\n<\/pre>\n<p>The above code demonstrates how to use <code>ByteBuffersDirectory<\/code> for in-memory indexing and searching. We create an index in memory, add a document to it, and then search for a term within the content field. The in-memory nature of <code>ByteBuffersDirectory<\/code> makes the search operation very fast.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p>The output of the above program would be:<\/p>\n<pre class=\"brush:plain; wrap-lines:false;\">Found: Lucene in Action\n<\/pre>\n<h2><a name=\"lucene-mmapdirectory-example\"><\/a>3. Lucene MMapDirectory Example<\/h2>\n<p>The <code>MMapDirectory<\/code> is a directory implementation that uses memory-mapped files for storage. This can be beneficial for large indexes as it allows the operating system to manage the memory efficiently, potentially improving performance over traditional file-based I\/O. Here is a simple example of how to use <code>MMapDirectory<\/code>:<\/p>\n<pre class=\"brush:java; wrap-lines:false;\">import org.apache.lucene.analysis.standard.StandardAnalyzer;\nimport org.apache.lucene.document.Document;\nimport org.apache.lucene.document.Field;\nimport org.apache.lucene.document.StringField;\nimport org.apache.lucene.document.TextField;\nimport org.apache.lucene.index.IndexWriter;\nimport org.apache.lucene.index.IndexWriterConfig;\nimport org.apache.lucene.search.IndexSearcher;\nimport org.apache.lucene.search.Query;\nimport org.apache.lucene.search.ScoreDoc;\nimport org.apache.lucene.search.TopDocs;\nimport org.apache.lucene.search.TermQuery;\nimport org.apache.lucene.store.Directory;\nimport org.apache.lucene.store.MMapDirectory;\n\nimport java.nio.file.Paths;\n\npublic class MMapDirectoryExample {\n    public static void main(String[] args) throws Exception {\n        Directory directory = new MMapDirectory(Paths.get(\"mmap_index\"));\n        StandardAnalyzer analyzer = new StandardAnalyzer();\n        IndexWriterConfig config = new IndexWriterConfig(analyzer);\n        IndexWriter writer = new IndexWriter(directory, config);\n\n        Document doc = new Document();\n        doc.add(new StringField(\"title\", \"Lucene in Action\", Field.Store.YES));\n        doc.add(new TextField(\"content\", \"Lucene is a search library\", Field.Store.YES));\n        writer.addDocument(doc);\n\n        writer.close();\n\n        IndexSearcher searcher = new IndexSearcher(DirectoryReader.open(directory));\n        Query query = new TermQuery(new Term(\"content\", \"search\"));\n        TopDocs results = searcher.search(query, 10);\n        for (ScoreDoc sd : results.scoreDocs) {\n            Document foundDoc = searcher.doc(sd.doc);\n            System.out.println(\"Found: \" + foundDoc.get(\"title\"));\n        }\n        directory.close();\n    }\n}\n<\/pre>\n<p>This example demonstrates how to use <code>MMapDirectory<\/code> for indexing and searching. We create an index on disk using memory-mapped files, add a document to it, and then perform a search. The memory-mapped nature allows the operating system to load the required parts of the index into memory as needed, which can be more efficient for large indexes.<\/p>\n<p>The output of the above program would be:<\/p>\n<pre class=\"brush:plain; wrap-lines:false;\">Found: Lucene in Action\n<\/pre>\n<h2><a name=\"comparison\"><\/a>4. Comparison<\/h2>\n<table>\n<thead>\n<tr>\n<th>Feature<\/th>\n<th>ByteBuffersDirectory<\/th>\n<th>MMapDirectory<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>Advantages<\/strong><\/td>\n<td>\n<ul>\n<li>Fast in-memory read\/write operations<\/li>\n<li>No disk I\/O overhead<\/li>\n<\/ul>\n<\/td>\n<td>\n<ul>\n<li>Efficient memory usage for large indexes<\/li>\n<li>OS handles memory management<\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<tr>\n<td><strong>Disadvantages<\/strong><\/td>\n<td>\n<ul>\n<li>Limited by available heap memory<\/li>\n<li>Not suitable for very large indexes<\/li>\n<\/ul>\n<\/td>\n<td>\n<ul>\n<li>Potentially slower than in-memory operations for small indexes<\/li>\n<li>Requires memory-mapped file support<\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<tr>\n<td><strong>Memory<\/strong><\/td>\n<td>Utilizes JVM heap memory for storage, which can lead to higher GC overhead and limits size based on heap settings.<\/td>\n<td>Utilizes off-heap memory through memory-mapped files, reducing JVM heap usage and potentially allowing larger indexes.<\/td>\n<\/tr>\n<tr>\n<td><strong>Performance<\/strong><\/td>\n<td>High performance for read\/write operations due to in-memory storage, best for small to medium datasets.<\/td>\n<td>Good performance for large datasets, especially when managed by the OS, but may have overhead for small datasets compared to in-memory solutions.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2><a name=\"conclusion\"><\/a>5. Conclusion<\/h2>\n<p>Both <code>ByteBuffersDirectory<\/code> and <code>MMapDirectory<\/code> provide unique advantages depending on the use case. <code>ByteBuffersDirectory<\/code> is ideal for scenarios needing fast in-memory operations, while <code>MMapDirectory<\/code> is suitable for managing large indexes with efficient memory usage. Understanding these differences helps in choosing the appropriate directory implementation for optimizing search performance in Apache Lucene.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Apache Lucene is a powerful search library written in Java. It provides various directory implementations for storing index files, such as ByteBuffersDirectory and MMapDirectory. These directories differ in how they manage file I\/O operations. Let us delve into understanding MmapDirectory and ByteBuffersDirectory with the use of basic examples. 1. Maven Dependency To use Lucene in &hellip;<\/p>\n","protected":false},"author":26931,"featured_media":71,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[26,1348],"class_list":["post-123903","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-apache-lucene","tag-lucene"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Lucene MMapDirectory and ByteBuffersDirectory Examples - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"MMapDirectory ByteBuffersDirectory examples: Examples of Lucene MMapDirectory and ByteBuffersDirectory, comparing performance and use cases.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/lucene-mmapdirectory-and-bytebuffersdirectory-example.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Lucene MMapDirectory and ByteBuffersDirectory Examples - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"MMapDirectory ByteBuffersDirectory examples: Examples of Lucene MMapDirectory and ByteBuffersDirectory, comparing performance and use cases.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/lucene-mmapdirectory-and-bytebuffersdirectory-example.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2024-06-25T12:19:41+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-06-25T12:19:44+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-lucene-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Yatin Batra\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Yatin Batra\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/lucene-mmapdirectory-and-bytebuffersdirectory-example.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/lucene-mmapdirectory-and-bytebuffersdirectory-example.html\"},\"author\":{\"name\":\"Yatin Batra\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/cda31a4c1965373fed40c8907dc09b8d\"},\"headline\":\"Lucene MMapDirectory and ByteBuffersDirectory Examples\",\"datePublished\":\"2024-06-25T12:19:41+00:00\",\"dateModified\":\"2024-06-25T12:19:44+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/lucene-mmapdirectory-and-bytebuffersdirectory-example.html\"},\"wordCount\":471,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/lucene-mmapdirectory-and-bytebuffersdirectory-example.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/apache-lucene-logo.jpg\",\"keywords\":[\"Apache Lucene\",\"Lucene\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/lucene-mmapdirectory-and-bytebuffersdirectory-example.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/lucene-mmapdirectory-and-bytebuffersdirectory-example.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/lucene-mmapdirectory-and-bytebuffersdirectory-example.html\",\"name\":\"Lucene MMapDirectory and ByteBuffersDirectory Examples - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/lucene-mmapdirectory-and-bytebuffersdirectory-example.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/lucene-mmapdirectory-and-bytebuffersdirectory-example.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/apache-lucene-logo.jpg\",\"datePublished\":\"2024-06-25T12:19:41+00:00\",\"dateModified\":\"2024-06-25T12:19:44+00:00\",\"description\":\"MMapDirectory ByteBuffersDirectory examples: Examples of Lucene MMapDirectory and ByteBuffersDirectory, comparing performance and use cases.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/lucene-mmapdirectory-and-bytebuffersdirectory-example.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/lucene-mmapdirectory-and-bytebuffersdirectory-example.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/lucene-mmapdirectory-and-bytebuffersdirectory-example.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/apache-lucene-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/apache-lucene-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/lucene-mmapdirectory-and-bytebuffersdirectory-example.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Lucene MMapDirectory and ByteBuffersDirectory Examples\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/cda31a4c1965373fed40c8907dc09b8d\",\"name\":\"Yatin Batra\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/12\\\/Yatin.batra_.jpg\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/12\\\/Yatin.batra_.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/12\\\/Yatin.batra_.jpg\",\"caption\":\"Yatin Batra\"},\"description\":\"An experience full-stack engineer well versed with Core Java, Spring\\\/Springboot, MVC, Security, AOP, Frontend (Angular &amp; React), and cloud technologies (such as AWS, GCP, Jenkins, Docker, K8).\",\"sameAs\":[\"https:\\\/\\\/www.javacodegeeks.com\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/yatin-batra\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Lucene MMapDirectory and ByteBuffersDirectory Examples - Java Code Geeks","description":"MMapDirectory ByteBuffersDirectory examples: Examples of Lucene MMapDirectory and ByteBuffersDirectory, comparing performance and use cases.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/lucene-mmapdirectory-and-bytebuffersdirectory-example.html","og_locale":"en_US","og_type":"article","og_title":"Lucene MMapDirectory and ByteBuffersDirectory Examples - Java Code Geeks","og_description":"MMapDirectory ByteBuffersDirectory examples: Examples of Lucene MMapDirectory and ByteBuffersDirectory, comparing performance and use cases.","og_url":"https:\/\/www.javacodegeeks.com\/lucene-mmapdirectory-and-bytebuffersdirectory-example.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2024-06-25T12:19:41+00:00","article_modified_time":"2024-06-25T12:19:44+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-lucene-logo.jpg","type":"image\/jpeg"}],"author":"Yatin Batra","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Yatin Batra","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/lucene-mmapdirectory-and-bytebuffersdirectory-example.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/lucene-mmapdirectory-and-bytebuffersdirectory-example.html"},"author":{"name":"Yatin Batra","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/cda31a4c1965373fed40c8907dc09b8d"},"headline":"Lucene MMapDirectory and ByteBuffersDirectory Examples","datePublished":"2024-06-25T12:19:41+00:00","dateModified":"2024-06-25T12:19:44+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/lucene-mmapdirectory-and-bytebuffersdirectory-example.html"},"wordCount":471,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/lucene-mmapdirectory-and-bytebuffersdirectory-example.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-lucene-logo.jpg","keywords":["Apache Lucene","Lucene"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/lucene-mmapdirectory-and-bytebuffersdirectory-example.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/lucene-mmapdirectory-and-bytebuffersdirectory-example.html","url":"https:\/\/www.javacodegeeks.com\/lucene-mmapdirectory-and-bytebuffersdirectory-example.html","name":"Lucene MMapDirectory and ByteBuffersDirectory Examples - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/lucene-mmapdirectory-and-bytebuffersdirectory-example.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/lucene-mmapdirectory-and-bytebuffersdirectory-example.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-lucene-logo.jpg","datePublished":"2024-06-25T12:19:41+00:00","dateModified":"2024-06-25T12:19:44+00:00","description":"MMapDirectory ByteBuffersDirectory examples: Examples of Lucene MMapDirectory and ByteBuffersDirectory, comparing performance and use cases.","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/lucene-mmapdirectory-and-bytebuffersdirectory-example.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/lucene-mmapdirectory-and-bytebuffersdirectory-example.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/lucene-mmapdirectory-and-bytebuffersdirectory-example.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-lucene-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-lucene-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/lucene-mmapdirectory-and-bytebuffersdirectory-example.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"Lucene MMapDirectory and ByteBuffersDirectory Examples"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/cda31a4c1965373fed40c8907dc09b8d","name":"Yatin Batra","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/12\/Yatin.batra_.jpg","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/12\/Yatin.batra_.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/12\/Yatin.batra_.jpg","caption":"Yatin Batra"},"description":"An experience full-stack engineer well versed with Core Java, Spring\/Springboot, MVC, Security, AOP, Frontend (Angular &amp; React), and cloud technologies (such as AWS, GCP, Jenkins, Docker, K8).","sameAs":["https:\/\/www.javacodegeeks.com"],"url":"https:\/\/www.javacodegeeks.com\/author\/yatin-batra"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/123903","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/26931"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=123903"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/123903\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/71"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=123903"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=123903"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=123903"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}