- NUM_RESULT=`echo "$output" | grep "Number of nodes " | grep -o '[0-9]*'`
- time=`echo "$output" | grep "Execution time" | cut -f 2 -d',' | grep -o '[0-9.]*'`
- TIME_COUNT=`echo "$time" | sort -g | head -1`
-
- output=`./main.native -b "$doc" "$query" /dev/null 2>&1`
- mtime=`echo "$output" | grep "Execution time" | cut -f 2 -d',' | grep -o '[0-9.]*'`
- ptime=`echo "$output" | grep "Serializing" | grep -o '[0-9.]*'`
- TIME_MAT=`echo "$mtime" | sort -g | head -1`
- TIME_PRINT="$ptime"
+ NUM_RESULT=`echo "$output" | grep "Number of results" | grep -o '[0-9]*'`
+ time=`echo "$output" | grep "Execution time" | cut -f 2 -d',' | cut -f1 -d ':' | grep -o '[0-9.]*'`
+ TIME_COUNT=`echo "$time" | tail -n +2 | average`
+ if [ -z "$count" ]
+ then
+ output=`./main.native -b -r "$3" "$doc" "$query" /dev/null 2>&1`
+ mtime=`echo "$output" | grep "Execution time" | cut -f 2 -d',' | cut -f1 -d ':'| grep -o '[0-9.]*'`
+ ptime=`echo "$output" | grep 'Serialization time' | cut -f 3 -d ' ' | grep -o '[0-9.]*'`
+ TIME_MAT=`echo "$mtime" | tail -n +2 | average`
+ TIME_PRINT="$ptime"
+ else
+ TIME_MAT="999999"
+ TIME_PRINT="0"
+ fi