mirror of
https://github.com/openobserve/openobserve.git
synced 2026-11-06 08:09:24 +00:00
fix: disable search around for aggregation query (#7441)
This commit is contained in:
@@ -2247,6 +2247,11 @@ const useLogs = () => {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(searchObj.data.query.toLowerCase().includes("group by")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false; // No aggregation function or non-null groupby property found
|
||||
}
|
||||
|
||||
@@ -6621,7 +6626,8 @@ const useLogs = () => {
|
||||
getStream,
|
||||
initialLogsState,
|
||||
clearSearchObj,
|
||||
setCommunicationMethod
|
||||
setCommunicationMethod,
|
||||
hasAggregation,
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -288,7 +288,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
<div
|
||||
v-show="
|
||||
streamType !== 'enrichment_tables' &&
|
||||
searchObj.data.stream.selectedStream.length <= 1
|
||||
searchObj.data.stream.selectedStream.length <= 1 &&
|
||||
hasAggregationQuery == false
|
||||
"
|
||||
class="col-8 row justify-center align-center q-gutter-sm"
|
||||
>
|
||||
@@ -335,7 +336,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, ref, onBeforeMount } from "vue";
|
||||
import { defineComponent, ref, onBeforeMount, computed } from "vue";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useStore } from "vuex";
|
||||
@@ -414,9 +415,13 @@ export default defineComponent({
|
||||
const selectedRelativeValue = ref("10");
|
||||
const recordSizeOptions: any = ref([10, 20, 50, 100, 200, 500, 1000]);
|
||||
const shouldWrapValues: any = ref(true);
|
||||
const { searchObj } = useLogs();
|
||||
const { searchObj, fnParsedSQL, hasAggregation } = useLogs();
|
||||
const $q = useQuasar();
|
||||
let multiStreamFields: any = ref([]);
|
||||
let hasAggregationQuery: any = computed(() => {
|
||||
let parsedSQL = fnParsedSQL();
|
||||
return hasAggregation(parsedSQL?.columns);
|
||||
});
|
||||
|
||||
onBeforeMount(() => {
|
||||
if (window.localStorage.getItem("wrap-log-details") === null) {
|
||||
@@ -493,6 +498,7 @@ export default defineComponent({
|
||||
searchObj,
|
||||
multiStreamFields,
|
||||
viewTrace,
|
||||
hasAggregationQuery,
|
||||
};
|
||||
},
|
||||
async created() {
|
||||
|
||||
Reference in New Issue
Block a user