Skip to content

Commit

Permalink
1.22.2.1
Browse files Browse the repository at this point in the history
fix : searching "all" with a sort returned records that user should not see
bug found by "grand lyon"
  • Loading branch information
jygaulier committed Sep 3, 2015
1 parent b0c6dfa commit a8efd5e
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 10 deletions.
39 changes: 39 additions & 0 deletions changelog.txt
@@ -1,3 +1,42 @@
1.22.2.1
fix : searching "all" with a sort returned records that user should not see
bug found by "grand lyon"


1.22.2.0
searching with stem (lng) searches also non-stem index
ex. : caption contains "Echappées", searching...

now

..."echappees" (whith stemming='fr') --> 0
..."echappées" (whith stemming='fr') --> found

..."echappees" (whith stemming='en') --> found
..."echappées" (whith stemming='en') --> found

..."echappees" (whithout stemming) --> found
..."echappées" (whithout stemming) --> found

previous version

..."echappees" (whith stemming='fr') -->
..."échappees" (whith stemming='fr') -->
..."echappées" (whith stemming='fr') --> ok
..."échappées" (whith stemming='fr') --> ok

..."echappees" (whith stemming='en') --> ok
..."échappees" (whith stemming='en') --> ok
..."echappées" (whith stemming='en') --> ok
..."échappées" (whith stemming='en') --> ok

..."echappees" (whithout stemming) --> ok
..."échappees" (whithout stemming) --> ok
..."echappées" (whithout stemming) --> ok
..."échappées" (whithout stemming) --> ok



1.22.1.1
fix: search on business sometimes did not work (reopen PHRAS-203)

Expand Down
2 changes: 1 addition & 1 deletion php_phrasea2/_VERSION.h
Expand Up @@ -19,7 +19,7 @@
//

#ifndef PHDOTVERSION
#define PHDOTVERSION 1.22.1.1
#define PHDOTVERSION 1.22.2.1
#endif
//
//=======================================================================
39 changes: 30 additions & 9 deletions phrasea_engine/qtree.cpp
Expand Up @@ -36,9 +36,18 @@ char *kwclause(Cquerytree2Parm *qp, KEYWORD *k)
int llng = 0;
if(qp->lng)
{
// add lng to the query
// (QQQQ) AND lnq='LNG'
ltot += 1 + (llng = strlen(qp->lng)) + 11 + 1;
if(qp->lng[0] == '\0')
{
// add lng to the query
// "(" + QQQQ + ") AND lnq=''"
ltot += 1 + 12;
}
else
{
// add lng to the query
// "(" + QQQQ + ") AND (lng='' OR lnq='" + LLL + "')"
ltot += 1 + 22 + (llng = strlen(qp->lng)) + 2;
}
}

KEYWORD *k0 = k;
Expand Down Expand Up @@ -114,13 +123,25 @@ char *kwclause(Cquerytree2Parm *qp, KEYWORD *k)
}
}
}
// add lng to the query
if(qp->lng)
{
memcpy(p, ") AND lng='", 11);
p += 11;
memcpy(p, qp->lng, llng);
p += llng;
*p++ = '\'';
if(qp->lng[0] == '\0')
{
memcpy(p, ") AND lng=''", 12);
p += 12;
}
else
{
// memcpy(p, ") AND (lng='' OR lng='", 22);
// p += 22;
memcpy(p, ") AND (lng='", 12);
p += 12;
memcpy(p, qp->lng, llng);
p += llng;
*p++ = '\'';
*p++ = ')';
}
}

*p = '\0';
Expand Down Expand Up @@ -612,7 +633,7 @@ THREAD_ENTRYPOINT querytree2(void *_qp)
"%s%s" // " AND record.recordid=ZZZ"
, *(qp->psortField)
, qp->multidoc_mode==PHRASEA_MULTIDOC_ALL ? "":(qp->multidoc_mode==PHRASEA_MULTIDOC_DOCONLY ? " AND parent_record_id=0" : " AND parent_record_id=1")
, qp->use_mask ? "" : " AND ((status ^ mask_xor) & mask_and)=0"
, qp->use_mask ? " AND ((status ^ mask_xor) & mask_and)=0" : ""
, qp->srid ? " AND record.record_id=" : ""
, qp->srid ? qp->srid : ""
);
Expand Down

0 comments on commit a8efd5e

Please sign in to comment.