Commit 706aadd4 authored by Iker Hurtado's avatar Iker Hurtado
Browse files

Add the checkboxes that modify the search by Elements and Formula (III)

parent 0319bded
......@@ -7811,8 +7811,12 @@
this.searchQuery.forEach( (item, i) => {
if (this.queryTypes[i] === 'F'){
queryObj.bool.filter.push(this._getESSimpleMatch('formula_reduced', item));
console.log('getAllowOtherElementsYYYYYYYYYYYYY: '+this.formulaBox.getAllowOtherElements()+' '+this.formulaBox.getMultiplesOfFormula());
//if (this.elementTable.getAllowOtherElements())
//else
queryObj.bool.filter.push( this._getESSimpleMatch(
(this.formulaBox.getMultiplesOfFormula() ? 'formula_reduced' : 'formula'), item));
}else if (this.queryTypes[i] === 'MN'){
queryObj.bool.filter.push(this._getESSimpleMatch('material_name', item));
......@@ -7825,8 +7829,10 @@
if (elements.length > 0){ // If there are elements (there is no formula or material name)
queryObj.bool.filter.push(this._getFieldESMatch('atom_labels', elements, true));//getAtomsESMatch(elements));
console.log('getAllowOtherElementsYYYYYYYYYYYYY: '+this.elementTable.getAllowOtherElements());
if (this.elementTable.getAllowOtherElements())
queryObj.bool.filter.push(this._getFieldESMatch('atom_labels', elements, true));//getAtomsESMatch(elements));
else
queryObj.bool.filter.push(this._getESSimpleMatch('atom_labels_keyword', elements.join('')));
}
///atom_labels": { "operator": "and",
......@@ -9181,7 +9187,7 @@
//console.log("MATERIAL ",mat, mat.system_type);
html+=
`<tr class="mat-row" data-mat-id="${mat.id}">
<td > ${label} </td>
<td > ${label} [${mat.formula}] </td>
<td style="text-align:center" >
<!--<span info-sys-data="system-type">-->${mat.system_type} <!--</span>-->
</td>
......
......@@ -301,7 +301,7 @@ class MaterialList {
//console.log("MATERIAL ",mat, mat.system_type);
html+=
`<tr class="mat-row" data-mat-id="${mat.id}">
<td > ${label} </td>
<td > ${label} [${mat.formula}] </td>
<td style="text-align:center" >
<!--<span info-sys-data="system-type">-->${mat.system_type} <!--</span>-->
</td>
......
......@@ -204,8 +204,12 @@ class NewSearchMod {
this.searchQuery.forEach( (item, i) => {
if (this.queryTypes[i] === 'F'){
queryObj.bool.filter.push(this._getESSimpleMatch('formula_reduced', item));
console.log('getAllowOtherElementsYYYYYYYYYYYYY: '+this.formulaBox.getAllowOtherElements()+' '+this.formulaBox.getMultiplesOfFormula());
//if (this.elementTable.getAllowOtherElements())
//else
queryObj.bool.filter.push( this._getESSimpleMatch(
(this.formulaBox.getMultiplesOfFormula() ? 'formula_reduced' : 'formula'), item));
}else if (this.queryTypes[i] === 'MN'){
queryObj.bool.filter.push(this._getESSimpleMatch('material_name', item));
......@@ -218,8 +222,10 @@ class NewSearchMod {
if (elements.length > 0){ // If there are elements (there is no formula or material name)
queryObj.bool.filter.push(this._getFieldESMatch('atom_labels', elements, true));//getAtomsESMatch(elements));
console.log('getAllowOtherElementsYYYYYYYYYYYYY: '+this.elementTable.getAllowOtherElements());
if (this.elementTable.getAllowOtherElements())
queryObj.bool.filter.push(this._getFieldESMatch('atom_labels', elements, true));//getAtomsESMatch(elements));
else
queryObj.bool.filter.push(this._getESSimpleMatch('atom_labels_keyword', elements.join('')));
}
///atom_labels": { "operator": "and",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment