Hi Girish, it's the <seach:options/> node strored at
/v1/config/query/ST_transformed
that will contain the answer. Colleen is probably right -- this kind of
results discrepancy is generally the difference between unfiltered and
filtered results.
This is one of the big MarkLogic concepts -- unfiltered results only use
indexes, and may contain non-exact numbers if there are multiple results
per document. filtered results do a post-index check on each result,
which slows the query down, but also ensures exact results. The
filtering operation comes into play when your database is big, like,
millions of documents. Customers in that range do anything possible to
model documents so that the indexes have all the information they need
-- and they can run queries unfiltered.
So the options stored at the URL above may or may not have
<search-option>unfiltered</search-option> in which case try switching it
to filtered and see if the performance hit is acceptable.
Charles
On 12/16/2013 10:02 PM, Girish Kulkarni wrote:
This is the entire REST query with all the options....
http://localhost:8650/v1/search?q=((p0301)
<http://localhost:8650/v1/search?q=%28%28p0301%29> OR "P0300 THROUGH
P0310" OR "#1 mis fire" OR "P0301-P0308" OR "16685" OR "misfire codes"
OR "DROPPING NUMBER 1 CYLINDER AFTER WARM UP" OR "number 1 misfire" OR
"P0300-P0305" OR "P0301" OR "not firing on all cylinders" OR
"P0300-P0304" OR "cylender-1and4-misfired" OR "P0301 -304" OR
"CYLINDER #1 MISSFIRE" OR "P0300-P0306" OR "P0301-308" OR "#1 cyl
missfire" OR "P0300 - P0306" OR "P0301 -306" OR "P0300-304" OR "engine
missfire #1" OR "P0300-308" OR "P0300-306" OR "P0301-306" OR "MISFIRE
ON CYLINDER 1")&structuredQuery=<query
xmlns="http://marklogic.com/appservices/search">
<and-query>
<!-- collectionQuery from "collection" url parameter -->
<collection-query>
<uri>collection1</uri>
<uri>collection2</uri>
</collection-query>
<value-constraint-query>
<constraint-name>ymmeMatchValue</constraint-name>
<text>2000^Ford^Mustang^*^4.6</text>
<text>2000^Ford^Mustang^*^</text>
</value-constraint-query>
<or-query>
<term-query>
<text>p0301</text>
</term-query>
<value-constraint-query>
<text>p0301</text>
<constraint-name>fullTitle</constraint-name>
<weight>1.1</weight>
</value-constraint-query>
<value-constraint-query>
<text>p0301 *</text>
<constraint-name>fullTitle</constraint-name>
<weight>1.05</weight>
</value-constraint-query>
<word-constraint-query>
<text>p0301</text>
<constraint-name>RFUnstemmed</constraint-name>
<weight>1.15</weight>
</word-constraint-query>
<word-constraint-query>
<text>p0301</text>
<constraint-name>TSUnstemmed</constraint-name>
<weight>1.15</weight>
</word-constraint-query>
<word-constraint-query>
<text>p0301</text>
<constraint-name>STTipUnstemmed</constraint-name>
<weight>1.15</weight>
</word-constraint-query>
<word-constraint-query>
<text>p0301</text>
<constraint-name>AnsweredQuestionUnstemmed</constraint-name>
<weight>1.15</weight>
</word-constraint-query>
<word-constraint-query>
<text>p0301</text>
<constraint-name>CTMUnstemmed</constraint-name>
<weight>1.15</weight>
</word-constraint-query>
<word-constraint-query>
<text>p0301</text>
<constraint-name>WFPGUnstemmed</constraint-name>
<weight>1.15</weight>
</word-constraint-query>
<near-query>
<term-query>
<text>p0301</text>
</term-query>
<distance>10</distance>
<distance-weight>1.05</distance-weight>
<ordered>true</ordered>
</near-query>
<word-constraint-query>
<constraint-name>RFUnstemmed</constraint-name>
<weight>1.05</weight>
<text>p0301</text>
</word-constraint-query>
<word-constraint-query>
<constraint-name>TSUnstemmed</constraint-name>
<weight>1.05</weight>
<text>p0301</text>
</word-constraint-query>
<word-constraint-query>
<constraint-name>STTipUnstemmed</constraint-name>
<weight>1.05</weight>
<text>p0301</text>
</word-constraint-query>
<word-constraint-query>
<constraint-name>AnsweredQuestionUnstemmed</constraint-name>
<weight>1.05</weight>
<text>p0301</text>
</word-constraint-query>
<word-constraint-query>
<constraint-name>CTMUnstemmed</constraint-name>
<weight>1.05</weight>
<text>p0301</text>
</word-constraint-query>
<word-constraint-query>
<constraint-name>WFPGUnstemmed</constraint-name>
<weight>1.05</weight>
<text>p0301</text>
</word-constraint-query>
<value-constraint-query>
<constraint-name>FITCountBucket</constraint-name>
<text>1</text>
<weight>1.01</weight>
</value-constraint-query>
<value-constraint-query>
<constraint-name>FITCountBucket</constraint-name>
<text>2</text>
<weight>1.02</weight>
</value-constraint-query>
<value-constraint-query>
<constraint-name>FITCountBucket</constraint-name>
<text>3</text>
<weight>1.03</weight>
</value-constraint-query>
<value-constraint-query>
<constraint-name>FITCountBucket</constraint-name>
<text>4</text>
<weight>1.04</weight>
</value-constraint-query>
<value-constraint-query>
<constraint-name>FITCountBucket</constraint-name>
<text>5</text>
<weight>1.05</weight>
</value-constraint-query>
<value-constraint-query>
<constraint-name>FITCountBucket</constraint-name>
<text>6</text>
<weight>1.06</weight>
</value-constraint-query>
<value-constraint-query>
<constraint-name>FITCountBucket</constraint-name>
<text>7</text>
<weight>1.07</weight>
</value-constraint-query>
<value-constraint-query>
<constraint-name>FITCountBucket</constraint-name>
<text>8</text>
<weight>1.08</weight>
</value-constraint-query>
<value-constraint-query>
<constraint-name>FITCountBucket</constraint-name>
<text>9</text>
<weight>1.09</weight>
</value-constraint-query>
<value-constraint-query>
<constraint-name>FITCountBucket</constraint-name>
<text>10</text>
<weight>1.1</weight>
</value-constraint-query>
<value-constraint-query>
<constraint-name>FITCountBucket</constraint-name>
<text>11</text>
<weight>1.11</weight>
</value-constraint-query>
<value-constraint-query>
<constraint-name>FITCountBucket</constraint-name>
<text>12</text>
<weight>1.12</weight>
</value-constraint-query>
<value-constraint-query>
<constraint-name>FITCountBucket</constraint-name>
<text>13</text>
<weight>1.13</weight>
</value-constraint-query>
<value-constraint-query>
<constraint-name>FITCountBucket</constraint-name>
<text>14</text>
<weight>1.14</weight>
</value-constraint-query>
<value-constraint-query>
<constraint-name>FITCountBucket</constraint-name>
<text>15</text>
<weight>1.15</weight>
</value-constraint-query>
<value-constraint-query>
<constraint-name>FITCountBucket</constraint-name>
<text>16</text>
<weight>1.16</weight>
</value-constraint-query>
<value-constraint-query>
<constraint-name>FITCountBucket</constraint-name>
<text>17</text>
<weight>1.17</weight>
</value-constraint-query>
<value-constraint-query>
<constraint-name>FITCountBucket</constraint-name>
<text>18</text>
<weight>1.18</weight>
</value-constraint-query>
<value-constraint-query>
<constraint-name>FITCountBucket</constraint-name>
<text>19</text>
<weight>1.19</weight>
</value-constraint-query>
<value-constraint-query>
<constraint-name>FITCountBucket</constraint-name>
<text>20</text>
<weight>1.2</weight>
</value-constraint-query>
<value-constraint-query>
<constraint-name>FITCountBucket</constraint-name>
<text>21-25</text>
<weight>1.23</weight>
</value-constraint-query>
<value-constraint-query>
<constraint-name>FITCountBucket</constraint-name>
<text>26-30</text>
<weight>1.28</weight>
</value-constraint-query>
<value-constraint-query>
<constraint-name>FITCountBucket</constraint-name>
<text>31-40</text>
<weight>1.35</weight>
</value-constraint-query>
<value-constraint-query>
<constraint-name>FITCountBucket</constraint-name>
<text>41-50</text>
<weight>1.45</weight>
</value-constraint-query>
<value-constraint-query>
<constraint-name>FITCountBucket</constraint-name>
<text>51-100</text>
<weight>1.55</weight>
</value-constraint-query>
<value-constraint-query>
<constraint-name>FITCountBucket</constraint-name>
<text>100+</text>
<weight>1.7</weight>
</value-constraint-query>
<word-constraint-query>
<weight>1.05</weight>
<constraint-name>RF</constraint-name>
<text>p0301</text>
</word-constraint-query>
<word-constraint-query>
<weight>1.1</weight>
<constraint-name>TS</constraint-name>
<text>p0301</text>
</word-constraint-query>
<value-constraint-query>
<constraint-name>status</constraint-name>
<text>unanswered</text>
<weight>0.95</weight>
</value-constraint-query>
</or-query>
</and-query>
<operator-state>
<operator-name>transform</operator-name>
<state-name>STSearch</state-name>
</operator-state>
</query>&start=0&pageLength=20&options=ST_transformed&view=results&format=xml
On Mon, Dec 16, 2013 at 5:00 PM, Colleen Whitney
<[email protected] <mailto:[email protected]>>
wrote:
Can you show us the options you passed into each?
On a quick glance, I think the issue has to do with filtering but
it's hard to tell from what's here.
------------------------------------------------------------------------
*From:* [email protected]
<mailto:[email protected]>
[[email protected]
<mailto:[email protected]>] on behalf of
Girish Kulkarni [[email protected]
<mailto:[email protected]>]
*Sent:* Monday, December 16, 2013 4:47 PM
*To:* MarkLogic Developer Discussion
*Subject:* [MarkLogic Dev General] Rest APi count vs search:resolve
I am making a REST api call something like...
http://localhost:8600/v1/search?q=p0301&.....
I am passing the options as a huge strucured query. The result
shows me total=9 and actual results returned are only 7.
<search:responsexmlns:xs="http://www.w3.org/2001/XMLSchema"xmlns=""xmlns:search="http://marklogic.com/appservices/search"snippet-format="my-snippet"total="9"start="1"page-length="20">
Whereas when i pass in the same structured query in search:resolve
with the same query parameters i see total=7 and the actual result
count is also 7 and the results match as the ones in the REST api...
<search:response snippet-format="my-snippet" total="7" start="1"
page-length="10" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="" xmlns:search="http://marklogic.com/appservices/search">
What is causing the REST api to give me a false total number ?
Thanks,
Girish Kulkarni
_______________________________________________
General mailing list
[email protected]
<mailto:[email protected]>
http://developer.marklogic.com/mailman/listinfo/general
--
Girish Kulkarni
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general
--
Charles Greer
Senior Engineer
MarkLogic Corporation
[email protected]
Phone: +1 707 408 3277
www.marklogic.com
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general