{"id":44575,"date":"2015-09-27T22:07:45","date_gmt":"2015-09-27T19:07:45","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/?p=44575"},"modified":"2023-12-06T15:41:20","modified_gmt":"2023-12-06T13:41:20","slug":"lucene-query-search-syntax-examples","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2015\/09\/lucene-query-search-syntax-examples.html","title":{"rendered":"Lucene Query (Search) Syntax Examples"},"content":{"rendered":"<p><em>This article is part of our Academy Course titled <a href=\"http:\/\/www.javacodegeeks.com\/2015\/09\/apache-lucene-fundamentals\/\">Apache Lucene Fundamentals<\/a>.<\/p>\n<p>In this course, you will get an introduction to Lucene. You will see why a library like this is important and then learn how searching works in Lucene. Moreover, you will learn how to integrate Lucene Search into your own applications in order to provide robust searching capabilities. Check it out <a href=\"http:\/\/www.javacodegeeks.com\/2015\/09\/apache-lucene-fundamentals\/\">here<\/a>!<\/em><\/p>\n<div class=\"toc\">\n<p><strong>Table Of Contents<\/strong><\/p>\n<dl>\n<dt><a href=\"#introduction\">1. Introduction<\/a><\/dt>\n<dt><a href=\"#query-class\">2. The Query Class<\/a><\/dt>\n<dd>\n<dl>\n<dt><a href=\"#TermQuery\">2.1 TermQuery<\/a><\/dt>\n<dt><a href=\"#PhraseQuery\">2.2 PhraseQuery<\/a><\/dt>\n<dt><a href=\"#BooleanQuery\">2.3. BooleanQuery<\/a><\/dt>\n<dt><a href=\"#WildcardQuery\">2.4. WildcardQuery<\/a><\/dt>\n<dt><a href=\"#RegexpQuery\">2.5. RegexpQuery<\/a><\/dt>\n<dt><a href=\"#TermRangeQuery\">2.6. TermRangeQuery<\/a><\/dt>\n<dt><a href=\"#NumberRangeQuery\">2.7. NumberRangeQuery<\/a><\/dt>\n<dt><a href=\"#FuzzyQuery\">2.8. FuzzyQuery<\/a><\/dt>\n<dl>\n\t<\/dd>\n<\/dl>\n<\/div>\n<h2 id=\"introduction\">1. Introduction<\/h2>\n<p>In this lesson of our course we are going to investigate the basic querying mechanisms offerd by Lucene. As you might remember from the introductory lesson, Lucene does not send raw text to be searched to the index. It uses <code>Query<\/code> Objects for that. In this lesson we are going to see all the crucial components that line up, to convert human &#8211; written search phrases to representative structures like <code>Queries<\/code>.<\/p>\n<h2 id=\"query-class\">2. The Query Class<\/h2>\n<p>The <code>Query<\/code> class is a public abstract class that represents a query to the index. In this section we are going to see the most important Query sub &#8211; classes that you can use to perform highly tailored queries.<\/p>\n<h3 id=\"TermQuery\">2.1 TermQuery<\/h3>\n<p>This is the most simple and straightforward query you can perform against a Lucene index. You simply search for <code>Documents<\/code> that cointain a single word in a specific <code>Field<\/code>.<\/p>\n<p>The basic <code>TermQuery<\/code> constructor is defined as follows : <code>public TermQuery(Term t)<\/code>. As you remember from the fist lesson a <code>Term<\/code> consists of a two parts:<\/p>\n<ol>\n<li>The name of the <code>Field<\/code> in which this term resides.<\/li>\n<li>The actual value of the Term, which, in the great majority of cases, is a single word, obtained from the analysis of some plain text.<\/li>\n<\/ol>\n<p>So, if you want to create a TermQuery to find all <code>Documents<\/code> that contain the word <code>\"good\"<\/code> in their <code>\"content\"<\/code> <code>Field<\/code>, here&#8217;s how you can do it<\/p>\n<pre class=\"brush:java\">\nTermQuery termQuery = new TermQuery(new Term(\"content\",\"good\"));\n<\/pre>\n<p>We can use that to search for the word &#8220;static&#8221; in our previously created index:<\/p>\n<pre class=\"brush:java\">\nString q = \"static\"\n\nDirectory directory = FSDirectory.open(indexDir);\n\nIndexReader  indexReader  = DirectoryReader.open(directory);\n\nIndexSearcher searcher = new IndexSearcher(indexReader);\n\nAnalyzer analyzer = new StandardAnalyzer(Version.LUCENE_46);\n\nTermQuery termQuery = new TermQuery(new Term(\"content\",q));\n\nTopDocs topDocs =searcher.search(termQuery, maxHits);\n\nScoreDoc[] hits = topDocs.scoreDocs;\n\nfor (ScoreDoc hit : hits) {\n        int docId = hit.doc;\n        Document d = searcher.doc(docId);\n        System.out.println(d.get(\"fileName\") + \" Score :\" + hit.score);\n}\n\nSystem.out.println(\"Found \" + hits.length);\n<\/pre>\n<p>The output of this would be:<\/p>\n<pre class=\"brush:bash\">\nC:\\\\Users\\\\nikos\\\\Desktop\\\\LuceneFolders\\\\LuceneHelloWorld\\\\SourceFiles\\\\Product.java Score :0.29545835\nC:\\\\Users\\\\nikos\\\\Desktop\\\\LuceneFolders\\\\LuceneHelloWorld\\\\SourceFiles\\\\SimpleSearcher.java Score :0.27245367\nC:\\\\Users\\\\nikos\\\\Desktop\\\\LuceneFolders\\\\LuceneHelloWorld\\\\SourceFiles\\\\PropertyObject.java Score :0.24368995\nC:\\\\Users\\\\nikos\\\\Desktop\\\\LuceneFolders\\\\LuceneHelloWorld\\\\SourceFiles\\\\SimpleIndexer.java Score :0.14772917\nC:\\\\Users\\\\nikos\\\\Desktop\\\\LuceneFolders\\\\LuceneHelloWorld\\\\SourceFiles\\\\TestSerlvet.java Score :0.14621398\nC:\\\\Users\\\\nikos\\\\Desktop\\\\LuceneFolders\\\\LuceneHelloWorld\\\\SourceFiles\\\\ShoppingCartServlet.java Score :0.13785185\nC:\\\\Users\\\\nikos\\\\Desktop\\\\LuceneFolders\\\\LuceneHelloWorld\\\\SourceFiles\\\\MyServlet.java Score :0.12184498\nFound 7\n<\/pre>\n<p>As you can see, seven of my source files contained the <code>\"static\"<\/code> keyword. That is there is to it. Naturally, if you try to add another word in the query string, the search will return 0 results. For example if you set your query string to:<\/p>\n<pre class=\"brush:java\">\nString q = \"private static\"\n<\/pre>\n<p>The output would be :<\/p>\n<pre class=\"brush:bash\">\nFound 0\n<\/pre>\n<p>Now, I know that <code>\"private static\"<\/code> is present inside many of my source files. But as you might remember, we used the <code>StandarAnalyzer<\/code> to process the plain text retrieved from our files, in the indexing process. <code>StandardAnalyzer<\/code> splits the text into individual words, thus every <code>Term<\/code> contains one single word. You can choose not to tokenize an indexed <code>Field<\/code>. But I would suggest that you do that in <code>Fields<\/code> that contain meta &#8211; information about our Document, e.g. the title or the author, and not in the Fields that hold its content. For example if you choose not to tokenize and indexed Field with name <code>'author'<\/code> and value <code>'James Wilslow'<\/code>, the <code>Field<\/code> <code>'author'<\/code> will contain only one <code>Term<\/code> with value <code>'James Wilslow'<\/code> as a whole. If you did tokenize the <code>Field<\/code>, it would contain two <code>Terms<\/code>, one with value <code>'James'<\/code> and the other one with value <code>'Wilslow'<\/code> .<\/p>\n<h3 id=\"PhraseQuery\">2.2 PhraseQuery<\/h3>\n<p>With <code>PhraseQuery<\/code> you can search for <code>Documents<\/code> that contain a particular sequence of words, aka phrases.<\/p>\n<p>You can create a <code>PhraseQuery<\/code> like this:<\/p>\n<pre class=\"brush:java\">\nPhraseQuery phraseQuery = new PhraseQuery();\n<\/pre>\n<p>And then you can add <code>Terms<\/code> to it. For example if you want to search for <code>Documents<\/code> that contain the phrase &#8220;private static&#8221; in their &#8220;content&#8221; Field, you could do it like so:<\/p>\n<pre class=\"brush:java\">\nPhraseQuery phraseQuery = new PhraseQuery();\n\nphraseQuery.add(new Term(\"content\",\"private\"));\nphraseQuery.add(new Term(\"content\",\"static\"));\n\nTopDocs topDocs =searcher.search(phraseQuery, maxHits);\n\nScoreDoc[] hits = topDocs.scoreDocs;\n\nfor (ScoreDoc hit : hits) {\n      int docId = hit.doc;\n      Document d = searcher.doc(docId);\n      System.out.println(d.get(\"fileName\") + \" Score :\" + hit.score);\n}\n\nSystem.out.println(\"Found \" + hits.length);\n<\/pre>\n<p>The output would be :<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<pre class=\"brush:bash\">\nC:\\\\Users\\\\nikos\\\\Desktop\\\\LuceneFolders\\\\LuceneHelloWorld\\\\SourceFiles\\\\Product.java Score :0.54864377\nC:\\\\Users\\\\nikos\\\\Desktop\\\\LuceneFolders\\\\LuceneHelloWorld\\\\SourceFiles\\\\PropertyObject.java Score :0.45251375\nC:\\\\Users\\\\nikos\\\\Desktop\\\\LuceneFolders\\\\LuceneHelloWorld\\\\SourceFiles\\\\SimpleSearcher.java Score :0.45251375\nC:\\\\Users\\\\nikos\\\\Desktop\\\\LuceneFolders\\\\LuceneHelloWorld\\\\SourceFiles\\\\TestSerlvet.java Score :0.27150828\nC:\\\\Users\\\\nikos\\\\Desktop\\\\LuceneFolders\\\\LuceneHelloWorld\\\\SourceFiles\\\\ShoppingCartServlet.java Score :0.25598043\nC:\\\\Users\\\\nikos\\\\Desktop\\\\LuceneFolders\\\\LuceneHelloWorld\\\\SourceFiles\\\\MyServlet.java Score :0.22625688\nC:\\\\Users\\\\nikos\\\\Desktop\\\\LuceneFolders\\\\LuceneHelloWorld\\\\SourceFiles\\\\SimpleIndexer.java Score :0.22398287\nFound 7\n<\/pre>\n<p>A <code>Document<\/code> makes it into the results, only if the <code>Field<\/code> contains both the words <code>\"private\"<\/code> and <code>\"static\"<\/code>, consecutively and in that exact order.<\/p>\n<p>So if you change the above code in something like this:<\/p>\n<pre class=\"brush:java\">\nphraseQuery.add(new Term(\"content\",\"private\"));\nphraseQuery.add(new Term(\"content\",\"final\"));\n<\/pre>\n<p>You will get :<\/p>\n<pre class=\"brush:bash\">\nFound 0\n<\/pre>\n<p>That&#8217;s because although my source files contains both of the words, the are not consecutive. To alter that behavior a little bit you can add a <code>slop<\/code> to the <code>PhraseQuery<\/code>. When you add a slop of 1, you allow at most one word to intervene between the words on your phrase. When you add slop 2, you allow at most 2 words between your words on the phrase.<\/p>\n<p>Interestingly : <em>&#8220;The slop is in fact an edit-distance, where the units correspond to moves of terms in the query phrase out of position. For example, to switch the order of two words requires two moves (the first move places the words atop one another), so to permit re-orderings of phrases, the slop must be at least two.&#8221;<\/em><\/p>\n<p>So if we do:<\/p>\n<pre class=\"brush:java\">\nPhraseQuery phraseQuery = new PhraseQuery();\n\nphraseQuery.add(new Term(\"content\",\"private\"));\nphraseQuery.add(new Term(\"content\",\"final\"));\n\nphraseQuery.setSlop(2);\n<\/pre>\n<p>The output of our search will give:<\/p>\n<pre class=\"brush:bash\">\nC:\\\\Users\\\\nikos\\\\Desktop\\\\LuceneFolders\\\\LuceneHelloWorld\\\\SourceFiles\\\\Product.java Score :0.38794976\nC:\\\\Users\\\\nikos\\\\Desktop\\\\LuceneFolders\\\\LuceneHelloWorld\\\\SourceFiles\\\\PropertyObject.java Score :0.31997555\nC:\\\\Users\\\\nikos\\\\Desktop\\\\LuceneFolders\\\\LuceneHelloWorld\\\\SourceFiles\\\\SimpleSearcher.java Score :0.31997555\nC:\\\\Users\\\\nikos\\\\Desktop\\\\LuceneFolders\\\\LuceneHelloWorld\\\\SourceFiles\\\\TestSerlvet.java Score :0.19198532\nC:\\\\Users\\\\nikos\\\\Desktop\\\\LuceneFolders\\\\LuceneHelloWorld\\\\SourceFiles\\\\ShoppingCartServlet.java Score :0.18100551\nC:\\\\Users\\\\nikos\\\\Desktop\\\\LuceneFolders\\\\LuceneHelloWorld\\\\SourceFiles\\\\MyServlet.java Score :0.15998778\nC:\\\\Users\\\\nikos\\\\Desktop\\\\LuceneFolders\\\\LuceneHelloWorld\\\\SourceFiles\\\\SimpleIndexer.java Score :0.15837982\n<\/pre>\n<p>It is important to mention that documents that contain phrases closer to the exact phrase of the query, will get higher scores.<\/p>\n<h3 id=\"BooleanQuery\">2.3 BooleanQuery<\/h3>\n<p><code>BooleanQuery<\/code> is a more expressive and powerful tool, as you can combine multiple Queries together with Boolean clauses. A BoleanQuery can be populated with BooleanClauses. A BooleanClause consists of a <code>Query<\/code>, and the role that that <code>Query<\/code> should have on the boolean search.<\/p>\n<p>To be more specific, a boolean clause can play the following roles in a query:<\/p>\n<ol>\n<li><code>MUST<\/code> : This is pretty self <code>explenatory<\/code>. A <code>Document<\/code> makes it to the list of the results, if and only if it contains that clause.<\/li>\n<li><code>MUST NOT<\/code> : It&#8217;s the exact opposite case. It is obligatory, for a Document to make it to the result list, not to contain that clause.<\/li>\n<li><code>SHOULD<\/code> : This is for clauses that can occur in a <code>Document<\/code>, but it is not necessary for them to include it in order to make it to the results.<\/li>\n<\/ol>\n<p>If you have a boolean query only with SHOULD clauses the results matches at least one of the clauses. This seems like the classic OR boolean operator but it is not so straightforward to use it properly.<\/p>\n<p>Now let&#8217;s see some examples. Let&#8217;s find the source files that contain the word &#8220;string&#8221; but don&#8217;t contain the word &#8220;int&#8221;.<\/p>\n<pre class=\"brush:java\">\nTermQuery termQuery = new TermQuery(new Term(\"content\",\"string\"));\nTermQuery termQuery2 = new TermQuery(new Term(\"content\",\"int\"));\n\nBooleanClause booleanClause1 = new BooleanClause(termQuery, BooleanClause.Occur.MUST);\nBooleanClause booleanClause2 = new BooleanClause(termQuery2, BooleanClause.Occur.MUST_NOT);\n\nBooleanQuery booleanQuery = new BooleanQuery();\nbooleanQuery.add(booleanClause1);\nbooleanQuery.add(booleanClause2);\n\nTopDocs topDocs =searcher.search(booleanQuery, maxHits);\n<\/pre>\n<p>Here is the result:<\/p>\n<pre class=\"brush:bash\">\nC:\\\\Users\\\\nikos\\\\Desktop\\\\LuceneFolders\\\\LuceneHelloWorld\\\\SourceFiles\\\\SimpleEJB.java Score :0.45057273\nC:\\\\Users\\\\nikos\\\\Desktop\\\\LuceneFolders\\\\LuceneHelloWorld\\\\SourceFiles\\\\PropertyObject.java Score :0.39020744\nC:\\\\Users\\\\nikos\\\\Desktop\\\\LuceneFolders\\\\LuceneHelloWorld\\\\SourceFiles\\\\ShoppingCartServlet.java Score :0.20150226\nC:\\\\Users\\\\nikos\\\\Desktop\\\\LuceneFolders\\\\LuceneHelloWorld\\\\SourceFiles\\\\TestSerlvet.java Score :0.13517183\nFound 4\n<\/pre>\n<p>Now let&#8217;s try to find all the Documents that contain the word &#8220;nikos&#8221; and the phrase &#8220;httpservletresponse response&#8221;. In the following snippet you can see how you can avoid creating <code>BooleanClause<\/code> instances, making your more compact.<\/p>\n<pre class=\"brush:java\">\nTermQuery termQuery = new TermQuery(new Term(\"content\",\"nikos\"));\n\nPhraseQuery phraseQuery = new PhraseQuery();\nphraseQuery.add(new Term(\"content\",\"httpservletresponse\"));\nphraseQuery.add(new Term(\"content\",\"response\"));\n\nBooleanQuery booleanQuery = new BooleanQuery();\n\nbooleanQuery.add(phraseQuery,BooleanClause.Occur.MUST);\nbooleanQuery.add(termQuery,BooleanClause.Occur.MUST);\n\nTopDocs topDocs =searcher.search(booleanQuery, maxHits);\n<\/pre>\n<p>This is the result:<\/p>\n<pre class=\"brush:bash\">\nC:\\\\Users\\\\nikos\\\\Desktop\\\\LuceneFolders\\\\LuceneHelloWorld\\\\SourceFiles\\\\ShoppingCartServlet.java Score :0.3148332\nFound 1\n<\/pre>\n<p>Let&#8217;s find all the Documents that contain the word &#8220;int&#8221; or the word &#8220;nikos&#8221;.As you might image you must use the SHOULD specification somehow:<\/p>\n<pre class=\"brush:java\">\nTermQuery termQuery = new TermQuery(new Term(\"content\",\"int\"));\nTermQuery termQuery2 = new TermQuery(new Term(\"content\",\"nikos\"));\n\nBooleanQuery booleanQuery = new BooleanQuery();\n\nbooleanQuery.add(termQuery,BooleanClause.Occur.SHOULD);\nbooleanQuery.add(termQuery2,BooleanClause.Occur.SHOULD);\n\nTopDocs topDocs =searcher.search(booleanQuery, maxHits);\n<\/pre>\n<p>This was not too hard but it is a bit tricky to create more complicated disjunctive queries. It is not always straightforward how you can use SHOULD correctly.<\/p>\n<p>For example let&#8217;s try to find all the Documents that contain the word &#8220;nikos&#8221; and the phrase &#8220;httpservletresponse response&#8221; or contain the word &#8220;int&#8221;. One could write something like this:<\/p>\n<pre class=\"brush:java\">\nTermQuery termQuery = new TermQuery(new Term(\"content\",\"nikos\"));\n\nPhraseQuery phraseQuery = new PhraseQuery();\nphraseQuery.add(new Term(\"content\",\"httpservletresponse\"));\nphraseQuery.add(new Term(\"content\",\"response\"));\n\nBooleanQuery booleanQuery = new BooleanQuery();\n\nbooleanQuery.add(phraseQuery,BooleanClause.Occur.MUST);\nbooleanQuery.add(termQuery,BooleanClause.Occur.MUST);\nbooleanQuery.add(new TermQuery(new Term(\"content\",\"int\")),BooleanClause.Occur.SHOULD);\n\nTopDocs topDocs =searcher.search(booleanQuery, maxHits);\n<\/pre>\n<p>But the query would fail to provide the results you want. Remember that the results of this query, as we&#8217;ve constructed in, MUST contain the word <code>\"nikos\"<\/code> and MUST contain the phrase <code>\"httpservletresponse response\"<\/code> in the same time. But this is not what you want. You want the documents that contain the word nikos and the phrase <code>\"httpservletresponse response\"<\/code>, but you also want documents that contain the word <code>\"int\"<\/code> independently, no matter if they contain the other clauses. To be fair, the above boolean query is a bit wrong. Because in straight boolean syntactic you would never write something like: A AND B OR C. You should write (A AND B) OR C. Or A AND (B OR C). See the difference?<\/p>\n<p>So you should write the query you want like : ( &#8220;nikos&#8221; AND &#8220;httpservletresponse response&#8221; ) OR &#8220;int&#8221;.<\/p>\n<p>You can do that combining <code>BooleanQueries<\/code> together. Using the above strict syntax it is not very hard to imagine how this would go:<\/p>\n<pre class=\"brush:java\">\nTermQuery termQuery = new TermQuery(new Term(\"content\",\"nikos\"));\n\nPhraseQuery phraseQuery = new PhraseQuery();\nphraseQuery.add(new Term(\"content\",\"httpservletresponse\"));\nphraseQuery.add(new Term(\"content\",\"response\"));\n\n\/\/ (A AND B)\nBooleanQuery conjunctiveQuery = new BooleanQuery();\nconjunctiveQuery.add(termQuery,BooleanClause.Occur.MUST);\nconjunctiveQuery.add(phraseQuery,BooleanClause.Occur.MUST);\n\nBooleanQuery disjunctiveQuery = new BooleanQuery();\n\n\/\/ (A AND B) OR C\ndisjunctiveQuery.add(conjunctiveQuery,BooleanClause.Occur.SHOULD);\ndisjunctiveQuery.add(new TermQuery(new Term(\"content\",\"int\")),BooleanClause.Occur.SHOULD);\n\nTopDocs topDocs =searcher.search(disjunctiveQuery, maxHits);\n<\/pre>\n<p>This is a quick guide you can follow when constructing boolean queries using <code>BooleanQuery<\/code> class:<\/p>\n<ul>\n<li>X AND Y<\/li>\n<pre class=\"brush:java\">\nBooleanQuery bool = new BooleanQuery();\nbool.add(X,BooleanClause.Occur.MUST);\nbool.add(Y,BooleanClause.Occur.MUST);<\/pre>\n<li>X OR Y<\/li>\n<pre class=\"brush:java\">\nBooleanQuery bool = new BooleanQuery();\nbool.add(X,BooleanClause.Occur.SHOULD);\nbool.add(Y,BooleanClause.Occur.SHOULD);\n<\/pre>\n<li>X AND (NOT Y)<\/li>\n<pre class=\"brush:java\">\nBooleanQuery bool = new BooleanQuery();\nbool.add(X,BooleanClause.Occur.MUST);\nbool.add(Y,BooleanClause.Occur.MUST_NOT);\n<\/pre>\n<li>(X AND Y) OR Z<\/li>\n<pre class=\"brush:java\">\nBooleanQuery conj = new BooleanQuery();\n\nconj.add(X,BooleanClause.Occur.MUST);\nconj.add(Y,BooleanClause.Occur.MUST);\n\nBooleanQuery disj = new BooleanQuery();\ndisj.add(conj,BooleanClause.Occur.SHOULD)\ndisj.add(Z,BooleanClause.Occur.SHOULD)\n\n<\/pre>\n<li>(X OR Y) AND Z<\/li>\n<pre class=\"brush:java\">\nBooleanQuery conj = new BooleanQuery();\n\nconj.add(X,BooleanClause.Occur.SHOULD);\nconj.add(Y,BooleanClause.Occur.SHOULD);\n\nBooleanQuery disj = new BooleanQuery();\ndisj.add(conj,BooleanClause.Occur.MUST)\ndisj.add(Z,BooleanClause.Occur.MUST)\n\n<\/pre>\n<li>X OR (NOT Z)<\/li>\n<pre class=\"brush:java\">\nBooleanQuery neg = new BooleanQuery();\n\nneg.add(Z,BooleanClause.Occur.MUST_OT);\n\nBooleanQuery disj = new BooleanQuery();\ndisj.add(neg,BooleanClause.Occur.SHOULD)\ndisj.add(X,BooleanClause.Occur.SHOULD)\n\n<\/pre>\n<\/ul>\n<p>The above can be used to create more and more complex boolean queries.<\/p>\n<h3 id=\"WildcardQuery\">2.4 WildcardQuery<\/h3>\n<p>As the name suggest, you can use WildcardQuery class to perform wildcard queries using &#8216;*&#8217; or &#8216;?&#8217; characters. For example if you want o search for documents that contain terms starting from &#8216;ni&#8217; followed by any other character sequence you can search for &#8216;ni*&#8217;. If you want to search for terms that start with &#8216;jamie&#8217; followed by (any) one character you can search for &#8216;jamie?&#8217;. Simple as that. Naturally, <code>WildcardQueries<\/code> are inefficient, because the search may have o go through a lot of different terms to find matches. It is generally a good practice to avoid placing the wildcard character at the front of the word, like &#8220;*abcde&#8221;.<\/p>\n<p>Let&#8217;s see an example:<\/p>\n<pre class=\"brush:java\">\nQuery wildcardQuery = new WildcardQuery(new Term(\"content\",\"n*os\"));\nTopDocs topDocs =searcher.search(wildcardQuery, maxHits);\n<\/pre>\n<p>And<\/p>\n<pre class=\"brush:java\">\nQuery wildcardQuery = new WildcardQuery(new Term(\"content\",\"niko?\"));\nTopDocs topDocs =searcher.search(wildcardQuery, maxHits);\n<\/pre>\n<h3 id=\"RegexpQuery\">2.5 RegexpQuery<\/h3>\n<p>Using <code>RegexpQuery<\/code>, you can perform fast regular expression queries, evaluated with a very fast automaton implementation by Lucene. Here is an example<\/p>\n<pre class=\"brush:java\">\nQuery regexpQuery = new RegexpQuery(new Term(\"content\",\"n[a-z]+\"));\n\nTopDocs topDocs =searcher.search(regexpQuery, maxHits);\n<\/pre>\n<h3 id=\"TermRangeQuery\">2.6 TermRangeQuery<\/h3>\n<p>This Query subclass is useful when performing range queries on string terms. For example, you can search for terms between &#8220;abc&#8221; and &#8220;xyz&#8221; words. The comparison of the words is executed with <code>Byte.compareTo(Byte)<\/code>. You might find this particularly useful for range queries in meta-data of your documents like titles and even dates (in case of dates be careful to use <code><a href=\"https:\/\/lucene.apache.org\/core\/4_6_0\/core\/org\/apache\/lucene\/document\/DateTools.html\">DateTools<\/a><\/code>).<\/p>\n<p>Here is how you can find all documents created during the last week:<\/p>\n<pre class=\"brush:java\">\nCalendar c = Calendar.getInstance();\nc.add(Calendar.DATE, -7);\nDate lastWeek = c.getTime();\n\nQuery termRangeQuery = TermRangeQuery.newStringRange(\"date\", DateTools.dateToString(new Date(), DateTools.Resolution.DAY),DateTools.dateToString(lastWeek, \n\nDateTools.Resolution.DAY),true,true);\n<\/pre>\n<p>Of course you have to be careful when indexing the &#8220;date&#8221; field. You have to apply <code>DateTools.dateToString<\/code> to it as well, and specify that field not to be analyzed (so it&#8217;s not tokenized and split into words).<\/p>\n<h3 id=\"NumberRangeQuery\">2.7 NumberRangeQuery<\/h3>\n<p>This is for performing numeric range queries. Imagine that you have a field &#8220;wordcount&#8221; that stores the number of the words of that document, and you want to retrieve documents that have between 2000 and 10000 words:<\/p>\n<pre class=\"brush:java\">\nQuery numericRangeQuery = NumericRangeQuery.newIntRange(\"wordcount\",2000,10000,true,true);\n<\/pre>\n<p>The boolean arguments dictate that the upper and lower limits are included in the range.<\/p>\n<h3 id=\"FuzzyQuery\">2.8 FuzzyQuery<\/h3>\n<p>This is a very interesting query sub class. This query evaluates terms according to proximity measures, like the well known Damerau-Levenshtein distance. This will find words that are lexicographic close. If you want to perform intense lexicographic application, like a dictionary or a word suggestion &#8220;did you mean&#8221; feature, you can use the <a href=\"https:\/\/lucene.apache.org\/core\/4_6_0\/suggest\/org\/apache\/lucene\/search\/spell\/package-summary.html\"><code>SpellChecker<\/code> API<\/a>.<\/p>\n<p>Let&#8217;s see how you can perform a fuzzy query search, with an unfortunate &#8216;string&#8217; misspelling:<\/p>\n<pre class=\"brush:java\">\nQuery fuzzyQuery = new FuzzyQuery(new Term(\"content\",\"srng\"));\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This article is part of our Academy Course titled Apache Lucene Fundamentals. In this course, you will get an introduction to Lucene. You will see why a library like this is important and then learn how searching works in Lucene. Moreover, you will learn how to integrate Lucene Search into your own applications in order &hellip;<\/p>\n","protected":false},"author":448,"featured_media":71,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[26],"class_list":["post-44575","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-apache-lucene"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Lucene Query (Search) Syntax Examples - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"This article is part of our Academy Course titled Apache Lucene Fundamentals. In this course, you will get an introduction to Lucene. You will see why a\" \/>\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\/2015\/09\/lucene-query-search-syntax-examples.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Lucene Query (Search) Syntax Examples - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"This article is part of our Academy Course titled Apache Lucene Fundamentals. In this course, you will get an introduction to Lucene. You will see why a\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2015\/09\/lucene-query-search-syntax-examples.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:author\" content=\"http:\/\/www.facebook.com\/phlocblogger\" \/>\n<meta property=\"article:published_time\" content=\"2015-09-27T19:07:45+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-06T13:41:20+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=\"Piyas De\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/phloxblog\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Piyas De\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/09\\\/lucene-query-search-syntax-examples.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/09\\\/lucene-query-search-syntax-examples.html\"},\"author\":{\"name\":\"Piyas De\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/20f3c9ff4b90d43da03decd2ad2b4f37\"},\"headline\":\"Lucene Query (Search) Syntax Examples\",\"datePublished\":\"2015-09-27T19:07:45+00:00\",\"dateModified\":\"2023-12-06T13:41:20+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/09\\\/lucene-query-search-syntax-examples.html\"},\"wordCount\":1632,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/09\\\/lucene-query-search-syntax-examples.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/apache-lucene-logo.jpg\",\"keywords\":[\"Apache Lucene\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/09\\\/lucene-query-search-syntax-examples.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/09\\\/lucene-query-search-syntax-examples.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/09\\\/lucene-query-search-syntax-examples.html\",\"name\":\"Lucene Query (Search) Syntax Examples - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/09\\\/lucene-query-search-syntax-examples.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/09\\\/lucene-query-search-syntax-examples.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/apache-lucene-logo.jpg\",\"datePublished\":\"2015-09-27T19:07:45+00:00\",\"dateModified\":\"2023-12-06T13:41:20+00:00\",\"description\":\"This article is part of our Academy Course titled Apache Lucene Fundamentals. In this course, you will get an introduction to Lucene. You will see why a\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/09\\\/lucene-query-search-syntax-examples.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/09\\\/lucene-query-search-syntax-examples.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2015\\\/09\\\/lucene-query-search-syntax-examples.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\\\/2015\\\/09\\\/lucene-query-search-syntax-examples.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 Query (Search) Syntax 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\\\/20f3c9ff4b90d43da03decd2ad2b4f37\",\"name\":\"Piyas De\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/eadd6728b7b5be23f0d6585da1a953926e49c6f2369703d6cb4f1147d4dd2203?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/eadd6728b7b5be23f0d6585da1a953926e49c6f2369703d6cb4f1147d4dd2203?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/eadd6728b7b5be23f0d6585da1a953926e49c6f2369703d6cb4f1147d4dd2203?s=96&d=mm&r=g\",\"caption\":\"Piyas De\"},\"description\":\"Piyas is Sun Microsystems certified Enterprise Architect with 10+ years of professional IT experience in various areas such as Architecture Definition, Define Enterprise Application, Client-server\\\/e-business solutions.Currently he is engaged in providing solutions for digital asset management in media companies.He is also founder and main author of \\\"Technical Blogs(Blog about small technical Know hows)\\\" Hyperlink - http:\\\/\\\/www.phloxblog.in\",\"sameAs\":[\"http:\\\/\\\/www.phloxblog.in\",\"http:\\\/\\\/www.facebook.com\\\/phlocblogger\",\"http:\\\/\\\/in.linkedin.com\\\/in\\\/piyasde\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/phloxblog\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/piyas-de\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Lucene Query (Search) Syntax Examples - Java Code Geeks","description":"This article is part of our Academy Course titled Apache Lucene Fundamentals. In this course, you will get an introduction to Lucene. You will see why a","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\/2015\/09\/lucene-query-search-syntax-examples.html","og_locale":"en_US","og_type":"article","og_title":"Lucene Query (Search) Syntax Examples - Java Code Geeks","og_description":"This article is part of our Academy Course titled Apache Lucene Fundamentals. In this course, you will get an introduction to Lucene. You will see why a","og_url":"https:\/\/www.javacodegeeks.com\/2015\/09\/lucene-query-search-syntax-examples.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_author":"http:\/\/www.facebook.com\/phlocblogger","article_published_time":"2015-09-27T19:07:45+00:00","article_modified_time":"2023-12-06T13:41:20+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":"Piyas De","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/phloxblog","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Piyas De","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2015\/09\/lucene-query-search-syntax-examples.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2015\/09\/lucene-query-search-syntax-examples.html"},"author":{"name":"Piyas De","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/20f3c9ff4b90d43da03decd2ad2b4f37"},"headline":"Lucene Query (Search) Syntax Examples","datePublished":"2015-09-27T19:07:45+00:00","dateModified":"2023-12-06T13:41:20+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2015\/09\/lucene-query-search-syntax-examples.html"},"wordCount":1632,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2015\/09\/lucene-query-search-syntax-examples.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-lucene-logo.jpg","keywords":["Apache Lucene"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2015\/09\/lucene-query-search-syntax-examples.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2015\/09\/lucene-query-search-syntax-examples.html","url":"https:\/\/www.javacodegeeks.com\/2015\/09\/lucene-query-search-syntax-examples.html","name":"Lucene Query (Search) Syntax Examples - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2015\/09\/lucene-query-search-syntax-examples.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2015\/09\/lucene-query-search-syntax-examples.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-lucene-logo.jpg","datePublished":"2015-09-27T19:07:45+00:00","dateModified":"2023-12-06T13:41:20+00:00","description":"This article is part of our Academy Course titled Apache Lucene Fundamentals. In this course, you will get an introduction to Lucene. You will see why a","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2015\/09\/lucene-query-search-syntax-examples.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2015\/09\/lucene-query-search-syntax-examples.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2015\/09\/lucene-query-search-syntax-examples.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\/2015\/09\/lucene-query-search-syntax-examples.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 Query (Search) Syntax 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\/20f3c9ff4b90d43da03decd2ad2b4f37","name":"Piyas De","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/eadd6728b7b5be23f0d6585da1a953926e49c6f2369703d6cb4f1147d4dd2203?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/eadd6728b7b5be23f0d6585da1a953926e49c6f2369703d6cb4f1147d4dd2203?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/eadd6728b7b5be23f0d6585da1a953926e49c6f2369703d6cb4f1147d4dd2203?s=96&d=mm&r=g","caption":"Piyas De"},"description":"Piyas is Sun Microsystems certified Enterprise Architect with 10+ years of professional IT experience in various areas such as Architecture Definition, Define Enterprise Application, Client-server\/e-business solutions.Currently he is engaged in providing solutions for digital asset management in media companies.He is also founder and main author of \"Technical Blogs(Blog about small technical Know hows)\" Hyperlink - http:\/\/www.phloxblog.in","sameAs":["http:\/\/www.phloxblog.in","http:\/\/www.facebook.com\/phlocblogger","http:\/\/in.linkedin.com\/in\/piyasde","https:\/\/x.com\/https:\/\/twitter.com\/phloxblog"],"url":"https:\/\/www.javacodegeeks.com\/author\/piyas-de"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/44575","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\/448"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=44575"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/44575\/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=44575"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=44575"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=44575"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}