implementazione ricerca avanzata, in progress
This commit is contained in:
parent
415691f7fc
commit
8f66ce7848
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
import { getVersiConCitazioni, queryRiferimenti, getListaRis, cleanListaRis, getFormaCntxt, getListaIdCommenti} from './dataMgr.js';
|
||||
import { getVersiConCitazioni, queryRiferimenti, getListaRis, cleanListaRis, getFormaCntxt, getListaIdCommenti} from './dataMgr_5.0.js';
|
||||
import { getJsonQuery, emptyStructCard } from './script_5.0.js';
|
||||
import {resetGraphStr} from './syntgraph_5.0.js'
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
import {numeroContesti, resetResult, showOffset} from './browseMgr_5.0.js'
|
||||
import { resetGraphStr } from './syntgraph_5.0.js';
|
||||
import { getAutoriFontiCitazioniS, getCommentatoriS, getAreeTematicheS, getFontiS} from './dataMgr.js';
|
||||
import { getAutoriFontiCitazioniS, getCommentatoriS, getAreeTematicheS, getFontiS} from './dataMgr_5.0.js';
|
||||
|
||||
export var getJsonQuery;
|
||||
export var fillStructCard;
|
||||
|
|
|
@ -444,7 +444,7 @@ function buildSQ(stquery) {
|
|||
buildSPQuery(stquery)
|
||||
return multipleCondSpQuery;
|
||||
}
|
||||
|
||||
var clausolaS='Clausola0'
|
||||
if (stquery['QueryAvanzata'] == 1 && stquery['EsprLogica'] != null && stquery['EsprLogica'] != '' && stquery['EsprLogica'].length == 1) {
|
||||
clause = stquery['EsprLogica']
|
||||
|
||||
|
@ -522,10 +522,12 @@ function buildSQ(stquery) {
|
|||
return multipleCondSpQuery;
|
||||
|
||||
}
|
||||
if (stquery[clause]['queryText'].trim() != "")
|
||||
clausolaS=clause
|
||||
}
|
||||
//Simple query
|
||||
|
||||
filtroContestoJson = getFiltroContestoJson(JSON.parse(stquery['Clausola0']['contesto']))
|
||||
filtroContestoJson = getFiltroContestoJson(JSON.parse(stquery[clausolaS]['contesto']))
|
||||
if (filtroContestoJson.length > 0) {
|
||||
for (tmpc of filtroContestoJson) {
|
||||
//console.log(filtroContesto[0])
|
||||
|
@ -535,20 +537,20 @@ function buildSQ(stquery) {
|
|||
|
||||
}
|
||||
|
||||
if (stquery['Clausola0']['queryText'] != "" && stquery['Clausola0']['Attiva'] == 1) {
|
||||
searchtext = stquery['Clausola0']['queryText']
|
||||
if (stquery[clausolaS]['queryText'] != "" && stquery[clausolaS]['Attiva'] == 1) {
|
||||
searchtext = stquery[clausolaS]['queryText']
|
||||
let strval = "^" + searchtext.trim() + "$"
|
||||
|
||||
if (stquery['Clausola0']['opzioni_testo'] == 'parola') {
|
||||
if (stquery[clausolaS]['opzioni_testo'] == 'parola') {
|
||||
strval = "^" + searchtext.trim() + "$";
|
||||
}
|
||||
if (stquery['Clausola0']['opzioni_testo'] == 'sottostringa') {
|
||||
if (stquery[clausolaS]['opzioni_testo'] == 'sottostringa') {
|
||||
strval = searchtext.trim();
|
||||
}
|
||||
if (stquery['Clausola0']['opzioni_testo'] == 'suffisso') {
|
||||
if (stquery[clausolaS]['opzioni_testo'] == 'suffisso') {
|
||||
strval = searchtext.trim() + "$";
|
||||
}
|
||||
if (stquery['Clausola0']['opzioni_testo'] == 'prefisso') {
|
||||
if (stquery[clausolaS]['opzioni_testo'] == 'prefisso') {
|
||||
strval = "^" + searchtext.trim();
|
||||
}
|
||||
|
||||
|
@ -556,7 +558,7 @@ function buildSQ(stquery) {
|
|||
|
||||
|
||||
parsedquery.where[0].expression.args[1].value = strval;
|
||||
if (stquery['Clausola0']['lemma_forma'] == 'lemma') {
|
||||
if (stquery[clausolaS]['lemma_forma'] == 'lemma') {
|
||||
parsedquery.where[0].expression.args[0].value = "lm";
|
||||
parsedquery.where.splice(1, 1)
|
||||
parsedquery.where[1].patterns[0].triples.splice(0, 1)
|
||||
|
|
Loading…
Reference in New Issue